Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# round to closest multiple

int value = 30;
int factor = 16;
int nearestMultiple = 
        (int)Math.Round(
             (value / (double)factor),
             MidpointRounding.AwayFromZero
         ) * factor;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #closest #multiple
ADD COMMENT
Topic
Name
7+1 =