Rounds a number to the specified number of digits.

Usage

Round(number, [digits])

number (required) Number to be rounded.

digits (optional) Number of decimal places to which to round.

The underlying formula is as follows: (number/10^digits) * (10^digits)

A negative digits value returns an integer with the specified least-significant digits zeroed.

Example

Round(Pi())
  • Returns 3
  • When no digit is specified, number is rounded to the nearest whole number.
Round(3.1, 2)
  • Returns 3.1
  • Rounding is different than formatting: The result may have fewer digits than specified. Rounding does not add trailing zeroes.
Round(1234, -2)
  • Returns 1200

More examples

See Also


Was this page helpful?
Yes No