+ 3
Convert Problem C#
(In C# Windows form application)how to convert numericupdown input to int?(vs2017)
1 ответ
+ 2
If your numericUpDown.Value input has only whole numbers without decimal places then you can convert directly to int without rounding:
Convert.ToInt32(numericUpDown1.Value);
If your numericUpDown.Value input contains decimal places, and has to be rounded first in order to convert to int, use Math.Round:
Convert.ToInt32(Math.Round(numericUpDown1.Value, 0));