|
|
Title | Round a number to a multiple of some number |
Keywords | round off, digits, multiple |
Categories | Algorithms |
|
|
Divide by the second number, round to the nearest integer, and then multiply by the second number again.
|
|
' Round a value to the nearest multiple of a number.
Private Function RoundToMultiple(ByVal value As Double, _
ByVal multiple As Integer) As Double
RoundToMultiple = CInt(value / multiple) * multiple
End Function
|
|
|
|
|
|