Documentation/Calc Functions/ROUND

From The Document Foundation Wiki
Jump to navigation Jump to search
Other languages:
English • ‎dansk



Function name:

ROUND

Category:

Mathematical

Summary:

Rounds a number to a certain number of decimal places.

Syntax:

ROUND(Number [; Count])

Returns:

Returns a real value which is the Number rounded to Count decimal places.

Arguments:

Number is a real number or a reference to the cell containing that number which is to be rounded.

Count is an integer or a reference to the cell containing that integer which is the number of decimal places to which Number is to be rounded.

  • If Count is omitted or zero, the function rounds to the nearest integer. If Count is negative, the function rounds to the nearest 10, 100, 1000, etc.
  • If Count is a non-integer value then the function uses the floor of the input value, i.e. it is truncated to an integer. For eg. 2.5 is truncated to 2 and -2.5 is truncated to -2.

Additional details:

This function rounds to the nearest number. See ROUNDDOWN and ROUNDUP for alternatives.

If the Number has an equal distance to two nearest numbers then the nearest number with higher magnitude is considered.

Examples:

Formula Description Returns
=ROUND(2.348;2) rounds 2.348 to 2 decimal places 2.35
=ROUND(-32.4834;3) rounds -32.4834 to 3 decimal places -32.483
=ROUND(2.348;0) give integer part of 2.348 2
=ROUND(2.5) rounds 2.5 to nearest integer 3
=ROUND(987.65;-2) rounds 987.65 to 2 places before decimal point 1000

Related LibreOffice functions:

ROUNDDOWN

ROUNDUP

TRUNC

INT

ODF standard:

Section 6.17.5, part2

Equivalent Excel functions:

ROUND