Posts tagged with "Maths"

Rounding to nearest X

Posted within Development on by Ryan Ball

An interesting forumla to remember for rounding numbers to the nearest X.

Int32 value = 43.7;
Int32 toNearest = 5;
Int32 result = Math.Round(value / toNearest) * toNearest;