numericUpDown prevent rounding int
I'm using numericUpDown with C# to represent integers. But there is a problem representing "b开发者_如何学Pythonig values". For instance if I assgin 127 to numericUpDown, it's displayed correctly. However, if I assign 12912347 it gets rounded to 12912350.
How can I avoid numericUpDown rounding integers?
(numericUpDown settings are: DecimalPlaces 0; Maximum 4294967295; Minimum 0)
All of the are decimal
values and it easily covers your range. Also i'm not able to reproduce this.
So it seems, that there is a problem somewhere else in your code that performs such a rounding.
Cannot reproduce that (Fx 4).
Value, Minimum and Maximum are all decimal
properties so there should not be a problem.
sorry, my mistake indeed. I used an invoke and there sth like this was done: float value = 12912347f; numericUpDown1.Value = Convert.ToDecimal(value); this conversion caused the rounding.
This question should probably be deleted.
精彩评论