Hi,
with Infragistics 20.1.104, given an SQL datatype like `numeric(23, 20)`, I'd like to use MaskInput to show an appropriate placeholder.
If I set it to `{LOC}-{double:3.20}`, though, the entire fractional portion gets set to a series of zeroes.
If I set it to `{LOC}-{double:3.19}`, this doesn't seem to occur.
So I think I'm running into some kind of internal limit?
Hello Soren,
Thank you for contacting. In order to understand the issue i set up a basic sample like this:
Hello Divya,
sorry for the confusion. Even though my MaskInput has 'double' in it, the underlying data is actually a System.Decimal, which does support this:
> decimal d = 1.12345678901234567890m; > d 1.12345678901234567890 > decimal d = 1.12345678901234567890123m; > d 1.12345678901234567890123
Regardless of whether such precision is actually preserved, though, it is an odd behavior that all decimal places get cut off / floored to zero.
Is there a different MaskInput I should be using?
You could set NumericType on the MaskEditor to Decimal. But I am pretty sure the control deals with the value as a double internally, so that might not help. There's no other masked input control. But perhaps with numbers this precise, you would be better off just using unmasked text?
Mike Saltzman said:But I am pretty sure the control deals with the value as a double internally, so that might not help.
Ah, I see.
(I still find it a little odd that it silently cuts off all digits rather than the remaining digits.
Mike Saltzman said:But perhaps with numbers this precise, you would be better off just using unmasked text?
Yeah, I suppose so.
Really, my primary goal wasn't so much masking as formatting — the mask is just a nice cherry on top that reassures the user their data won't be thrown away.
Am I correct to assume that I should use UltraTextEditor instead for such special cases? I can't seem to find a configuration that will use UltraNumericEditor, apply formatting (e.g., thousands separators), and support such precise numbers.
Yes, personally, I would use UltraTextEditor.Although, UltraTextEditor works with strings, to there's no way to format them automatically. You will basically just have to let the user enter a string and then use decimal.TryParse or something like that to retrieve the numeric value from the string. If you are binding the control to a data source, you can use the Parse and Format events of the Binding. Out of curiosity, what kind of application are you working on that requires SO many significant digits? :)