Round To Decimals
Rounds a number to the specified number of decimals.
Description
Rounds a number to the specified number of decimals.
If a negative number is provided, it will round to the next power of 10.
Examples
roundToDecimal(11.54, 1) = 11.5 roundToDecimal(11.54, 0) = 12 roundToDecimal(11.54, -1) = 10
Inputs
- n (Number)
- decimals (Number)
Outputs
- roundToDecimals(n) (Number)