Category: Number function
This function rounds a number to the desired multiple (grain).
|number||Number||The value, usually fractional, to be rounded.|
|grain||Number||The multiple to round number to.|
Return value type: Number
MRound uses "bankers rounding" which rounds a value ending in 5 to the nearest even value. This behavior is slightly different from that of the mround() function in Excel which always rounds away from zero.
mround(5.3, 0.5) //Returns 5.5
mround(10.05, 0.1) //Returns 10.0 (bankers rounding rounds to the closest even value)
mround(10.15, 0.1) //Returns 10.2 (bankers rounding rounds to the closest even value)
mround(20.78, 1) //Returns 21
mround(57, 15) //Returns 60