Back to Function Index
ROUND()
Overview
ROUND() rounds a number to a specified precision. If no precision is specified, it rounds to the nearest integer. This function is useful for numeric formatting, financial calculations, and data presentation where specific decimal precision is required.
Function Format
ROUND(number [, precision])
Return Value
ROUND() returns a numeric value
Examples
// Rounding to nearest integer
ROUND(10.333) = 10
ROUND(10.666) = 11
// Rounding to specific decimal places
ROUND(10.333, 2) = 10.330
ROUND(10.666, 2) = 10.670
// Handling negative numbers
ROUND(-10.333, 2) = -10.330
ROUND(-10.666, 2) = -10.67
// Edge cases
ROUND(0) = 0
ROUND(0, 2) = 0.00
ROUND(10.5) = 11
ROUND(-10.5) = -11
Notes
Important behaviors:
Rounds to nearest integer if precision is not specified Rounds to specified decimal places if precision is provided Handles both positive and negative numbers Preserves sign of the original number Rounds up when the digit is 5 or greater Common use cases include:
Financial calculations Data presentation Numeric formatting Statistical analysis Measurement rounding The function is useful for:
Precision control Data standardization Format consistency Calculation accuracy Considerations:
Precision must be a non-negative integer Zero precision rounds to nearest integer Negative precision rounds to left of decimal point Handles NULL values appropriately
See Also