How do you convert a double into the nearest int?
double d = 1.234; int i = Convert.ToInt32(d);
Reference
Handles rounding like so:
rounded to the nearest 32-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.
1.4m articles
1.4m replys
5 comments
57.0k users