Round a number to the specified number of digits.
number (required) Number to be rounded.
digits (optional) Number of decimal places to which to round.
NOTE: A negative digits value will return an integer with than many least-significant digits zeroed.
- Returns 3.14
- Returns 3.1
- Rounding is different than formatting: The result may have fewer digits than specified. Rounding does not add trailing zeroes.
- Returns 1200
More About Math Functions
These functions return well-known mathematical constants or implement common arithmetic functions.