Questions
Tags
I need to validate a textbox input and can only allow decimal inputs like: X,XXX (only one digit before decimal sign and a precision of 3).
textbox
X,XXX
I'm using C# and try this ^[0-9]+(\.[0-9]{1,2})?$?
^[0-9]+(\.[0-9]{1,2})?$
This question is related to c# regex decimal
c#
regex
decimal
^[0-9]([.,][0-9]{1,3})?$
It allows:
0 1 1.2 1.02 1.003 1.030 1,2 1,23 1,234
BUT NOT:
.1 ,1 12.1 12,1 1. 1, 1.2345 1,2345