Check out example codes for "c# round to closest multiple". It will help you in understanding the concepts better.

Code Example 1

int value = 30;
int factor = 16;
int nearestMultiple = 
        (int)Math.Round(
             (value / (double)factor),
             MidpointRounding.AwayFromZero
         ) * factor;

Learn ReactJs, React Native from akashmittal.com