How to check a string is numeric positive and possibly a comma as decimal separator and two decimal places maximum.
Example
10.25 is true 10.2 is true 10.236 is false theres 3 decimal 10.dee is false
or you can use this regexp
^[0-9]*([,]{1}[0-9]{0,2}){0,1}$
if you want both comma and dot as allowed separator then
^[0-9]*([\.,]{1}[0-9]{0,2}){0,1}$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With