ROUND

The ROUND function rounds a number to the nearest integer or the specified number of digits.

Syntax

ROUND(
    number,
    num_digits
)

Parameters
  • number: Number to round.
  • num_digits: Number of digits to round number to.
Returned value

The ROUND function returns a real number.

Additional Information

If num_digits is greater than zero, the number is rounded to that number of decimal places. If it is zero, it is rounded to the nearest integer. Finally, if it is negative, it is rounded to the left of the decimal point (to the nearest multiple of 10-num_digits, see example below).

Examples

This example rounds a positive and a negative number to a variable number of digits:

ROUND function. Example of use

In this other example, multiple numbers are rounded to zero digits. Notice how the result is the closest integer:

ROUND function. Example of use

The behavior of the different rounding functions is summarized below:

  • ROUNDDOWN: Rounds a number towards zero and the number of decimal places can be specified.
  • ROUNDUP: Rounds a number away from zero and the number of decimal places can be specified.
  • ROUND: Rounds a number towards the nearest rounding value and the number of decimal places can be specified.
  • INT: Rounds a number to the nearest equal or lower integer.
  • TRUNC: Rounds a number towards its integer part and the number of decimal places can be specified.

Examples:

Rounding functions

Related functions
Category
Mathematical and trigonometric
Submitted by admin on Tue, 12/04/2018 - 12:20