ROUND function

ROUND(Number, DigitCount?) ROUND(Number; DigitCount?)

Number

Number or { Number }

The number to be rounded.

DigitCount

Number or { Number } (optional)

The number of decimal places the resulting number should have, if the number is positive. If the number is negative, the number is rounded to the left of the decimal separator. If omitted, it is assumed to be 0, meaning that this function returns an integer.

Returns

Number or { Number }

A rounded number.

Returns a number rounded to a certain precision. Ties are rounded up, meaning that ROUND(1.5)ROUND(1,5) returns 2.

If the number of digits is not specified, 0 is assumed, which means that this function returns integers (whole numbers).

If the number if digits is positive, the parameter is interpreted as the number of decimal places the number should be rounded to. ROUND(1.49, 1)ROUND(1,49; 1) returns 1.5 (one decimal place) and ROUND(PI(), 5)ROUND(PI(); 5) returns 3.14159 (five decimal places).

If the number of digits is negative, the number is rounded to the left of the decimal separator. ROUND(123456789, -3)ROUND(123456789; -3) returns 123457000 and ROUND(123456789, -6)ROUND(123456789; -6) returns 123000000.

Examples

ROUND(1.5)ROUND(1,5)

Returns 2.

ROUND(1.5, 0)ROUND(1,5; 0)

Returns 2.

ROUND(1.49, 1)ROUND(1,49; 1)

Returns 1.5.

ROUND(PI(), 5)ROUND(PI(); 5)

Returns 3.14159.

ROUND(123456789, -3)ROUND(123456789; -3)

Returns 123457000.

ROUND(123456789, -6)ROUND(123456789; -6)

Returns 123000000.

ROUND(1.49, { 0, 1 })ROUND(1,49; { 0; 1 })

Returns the array { 1, 1.5 }{ 1; 1,5 }.

{ ROUND(1.49, 0), ROUND(1.49, 1) }{ ROUND(1,49; 0); ROUND(1,49; 1) }

Returns the array { 1, 1.5 }{ 1; 1,5 }.