I''m creating an application where i need to validate if the input in an inputbox is indeed correct.
So, if somebody types in: .40 it needs to convert it to: 0.40 and if it''s input is: 0.6 convert it to 0.60
Also if somebody types: 12. that it changed to 12.00.
I have an regular expression in the TxtInput_keypress event wich looks like so:
Expand|Select|Wrap|Line Numbers
- Dim Reg as new Regex("^([0-9]{1,4}).{1}([0-9]{0,2})$")
That means, it works but not i as i wishes.
Also i have an code in the TxtInput_LostFocus event that he adds a 0 at the and if the code is 0,6 for example.
And a regex for if there is no number before the . but al with all, it''s not working as i wish.
Does anyone has a good code for it?
Thanks!