Round a number n to the nearest increment of i. Always rounds up for values equidistant between increments, whether even or odd.
roundInc ( n As Number, _ i As Number ) As Number
Argument | Type | Description |
---|---|---|
n | Number | The input number . |
i | Number | The increment to round to. |
Intent >roundInc(5.73, 0.25) --> 5.75
Intent >roundInc(-0.37, 0.1) --> -0.4
Intent >roundInc(376.9, 10) --> 380.0
Intent >roundInc(385, 10) --> 390.0Compare this with roundToNearest(385, 10) which returns 380.0