Returning the nearest multiple value of a number

Posted by mouthpiec on Stack Overflow See other posts from Stack Overflow or by mouthpiec
Published on 2010-04-24T17:58:11Z Indexed on 2010/04/24 18:03 UTC
Read the original article Hit count: 171

Filed under:
|
|

Hi,

I need a function by which I will be able to convert a number to a nearest value of a given multiple.

Eg i want an array of number to be set to the neareast multiple of 16, so 2 = 0, 5 = 0, 11 = 16, 17 = 16, 30 = 32 etc

thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about multiple