I am using UltraNumericEditor in UI, using default min/max. In the initialization, I set the value to a negative number. Then it won't display it all. Also it locks the UI, can not tab it out until I input some positive number. I also can not type any negative number in there--that means it does not take "-" sign at all.
Did I miss anything here or how to do make it support negative numbers?
Thanks a lot!
Jisheng Xie
That makes more sense basically because the odds of a value going that far negative are small we have been getting lucky. Thanks for your response.
Hi Michael,
The difference is the number of digits you can type.
It's hard to see the difference with your example, because you have so many digits, but your users will not be able to enter the minimum value you have assigned. Let's example a simpler example:
MinValue: -99.99
MaxValue: 99.99
MaskInput: "nn.nn"
If you try to enter "-99.99" (the MinValue), you cannot, because there is only space for 3 digits before the decimal point and the minus sign counts as a digit.
If you want to be able to enter the full range of values, you would have to change the MaskInput to "-nn.nn" to allow for the minus sign and the full value "-99.99"
I know this is an old post but didn't see any reason to create a new post.
I am trying to figure out what is best practice for masked input. Currently we do not put a "-" at the front or end of our masked input and it has always accepted a negative sign and displayed it. I guess my question is what is best practice? Is it better to always put the negative at the front of the format or is it no longer necessary?
Here is how we setup numeric editors.
MaskInput "nnnnnn.nnn"
FormatString = "###,##0.000;(###,##0.000);0.000)
MinValue = "-999999.999"
MaxValue = "999999.999"
Currency Editors
MaskInput = "nnnnnn.nn"
FormatString = "C2"
MinValue = "-999999.99"
MaxValue = "999999.99"
Hi Mike.
I used "-nn" for integer and "-nn.99" for double and it solved the problem.
Thanks for your kind help :)
Okay, so it's using the default mask, which probably does not contain a minus sign. So you need to set the MaskInput to something with a minus sign, like "-nn"