Sunday, 18 August 2013

Rounding to the nearest whole number

Rounding to the nearest whole number

How do I round a float value to the nearest integral number in C#?
I see that the built-in Math.Round(value, MidpointRounding) doesn't have
an option to round to nearest whole number (and I wonder why of all
features), but maybe there's an easy solution to this problem?
Unfortunately, my lack of math skills doesn't allow me to come up with a
solution by myself.

No comments:

Post a Comment