Number.Round(number as nullable number, optional digits as nullable number, optional roundingMode as nullable number) as nullable number
Returns the result of rounding
number to the nearest number. If
number is null, Number.Round returns null.
number is rounded to the nearest integer, and ties are broken by rounding to the nearest even number (using RoundingMode.ToEven, also known as "banker's rounding").
However, these defaults can be overridden via the following optional parameters.
numberto be rounded to the specified number of decimal digits.
roundingMode: Overrides the default tie-breaking behavior when
numberis at the midpoint between two potential rounded values (refer to RoundingMode.Type for possible values).
Round 1.234 to the nearest integer.
Round 1.56 to the nearest integer.
Round 1.2345 to two decimal places.
Round 1.2345 to three decimal places (Rounding up).
Number.Round(1.2345, 3, RoundingMode.Up)
Round 1.2345 to three decimal places (Rounding down).
Number.Round(1.2345, 3, RoundingMode.Down)