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.
Just thought I'd chime in with the fact that Decimal support was added to the NumericType property of the UltraNumericEditor in a hotfix of 8.1, which is also the reason why the UltraCurrencyEditor was working for you.
-Matt
We don't see a numeric type of 'Decimal' in the UltraNumericEditor. In fact, the UltraMaskEdit seems to have the same issue and it does not show 'Decimal' Type in the list of EditAs.
I had thought that the fix to add the Decimal type to the UltraNumericEditor had made it into the latest hotfix for 8.1, so if you have downloaded this and it isn't there, it will be in the next one; you can contact Developer Support to be notified when the fix is available. Otherwise, it should be present in 8.2.
As for your issue with the UltraMaskedEdit, this control does not support the Decimal type. You could submit a feature request through Developer Support for it to do so.