If you want to round to the nearest int:
int rounded = (int)Math.Round(precise, 0);
You can also use:
int rounded = Convert.ToInt32(precise);
which will use Math.Round(x, 0); for rounding and throwing for you. It looks neater, but a little less clear. IMO.
If you want to round up :
int roundedUp = (int)Math.Ceiling(precise);
Matthew Brindley May 25 '09 at 12:13 a.m. 2009-05-25 00:13
source share