
Use ROUND to round a value to a specified number of decimal places, an integer, or a power of 10.
When the NEAREST direction argument is used, if the fractional part of x is .5 or greater:
- a positive value is rounded up,
- a negative value is rounded down.
It is also possible to round to a negative number of decimal places. This will round to powers of 10. The MROUND function can also be used to do this, and can also round to numbers that aren't a power of 10.
Syntax
ROUND(x[,y][,d][,m])
The ROUND function has the following arguments:
Argument | Data type | Description |
x: number | Numeric line item, property, or expression | The number that you want to round. |
y: number | Numeric line item, property, or expression | The number of decimal places to round x to. If omitted, x will be rounded to an integer. |
d: direction | Keyword |
This keyword determines which rounding direction the function uses to round. If omitted, the function uses the NEAREST direction. The available keywords are:
|
m: method | Keyword |
This keyword determines which rounding method the function uses. If omitted, the function uses the NORMAL rounding method. The available keywords are:
|
Returns
|
Numeric line item, property, or expression |
Excel equivalent
Examples
Formula | Description | Result |
ROUND(12.344) |
Only the value to be rounded, 12.344, has been provided. The formula uses the default arguments of: 0 decimal places, the NEAREST direction, and NORMAL rounding method | 12.0 |
ROUND(12.344, 1, DOWN) |
This formula contains arguments of 1 decimal place and the DOWN direction. This means that 12.344 is rounded down to one decimal place. | 12.3 |
ROUND(12.5) |
As this formula only contains ROUND and a value to be rounded, it uses the default arguments of: 0 decimal places, the NEAREST direction, and NORMAL rounding method. As 12.5 is a positive number, it rounds up. | 13 |
ROUND(-12.5) |
As this formula only contains ROUND and a value to be rounded, it uses the default arguments of: 0 decimal places, the NEAREST direction, and NORMAL rounding method. As -12.5 is a negative number, it rounds down. | -13 |
ROUND(532.8340, 2, TOWARDSZERO) |
This formula contains arguments of 2 decimal places and the TOWARDSZERO direction. This means that x is rounded down towards zero to 2 decimal places. This usage of ROUND could be used to calculate the price of a product. Rounding towards zero maximizes profit margin. | 532.83 |
ROUND(28.152839, 1, UP) |
This formula contains arguments of 1 decimal place and the UP direction. This means that 28.152839 is rounded up to one decimal place. | 28.2 |
ROUND(2.509, 2, NEAREST, NORMAL) |
This is an example where the NORMAL rounding method results in a small degree of error. | 2.5100000000000002 |
ROUND(2.509, 2, NEAREST, EXACT) |
The additional processing performed by the EXACT rounding method corrects the small degree of error in the previous example. | 2.51 |