Hi,
We have a ultraNumericEditor control with "Numeric Type" property set to double. The maximum value that we want to be able to enter in this field is 999999999999999.99 (15,2). However when we enter this number, it gets changed to all 0s. We have the MaskInput as nnnnnnnnnnnnnnn.nn and the MaxValue is set to 1E+20. Are we doing something wrong?
The double data type is inherently imprecise. And I beleive DotNet only allows up to 15 significant digits. Since you have 17 digits here, the value gets rounded.
To see what I mean, try this code:
double d = 999999999999999.99;Debug.WriteLine(d.ToString());
This will display: "1E+15" which is "1000000000000000.00". This is 18 digits, and your mask only allows for 17, so the first digits is stripped out.
If you need this kind of precision, UltraNumericEditor was recently updated to support the decimal data type, which is more precised, so you might want to use that if you have a more recent version of the controls. If not, you can try using the UltraMaskedEditor control with a decimal data type.
Mike, Thanks. BTW, this problem was resolved by replacing this control with UltraCurrencyEditor.