NO

Author Topic: ES_NUMBER does not allow periods?  (Read 4973 times)

tpekar

  • Guest
ES_NUMBER does not allow periods?
« on: October 04, 2012, 10:57:18 PM »
I am trying to restrict user input to just numbers and I find that in doing so ES_NUMBER will not allow the input of a period.  How does the user input a decimal point?

CommonTater

  • Guest
Re: ES_NUMBER does not allow periods?
« Reply #1 on: October 04, 2012, 11:26:35 PM »
Either remove the ES_NUMBER (which only allows integer values) or create a custom control.

If you remove ES_NUMBER you can check after each entry (catching EN_CHANGE) to ensure you have only characters from your own dictionary which, in this case would be "0123456789.,-"  and report an error if they mess up...

If you are inputting dollar values and assigning them to floats or doubles... you probably should read THIS first.  Most monetary software works in integer pennies, for the very reason that floating point math is never exactly accurate.
 
« Last Edit: October 04, 2012, 11:29:15 PM by CommonTater »