Hi everyone!
Im trying to create a regular expression that give me true:
- Number (decimal)
- Only two decimals
- the 2 decimals are obligatory (Examples: 1,00 /
0,00 /
5,10 /
1357,78)
I created the follow validation "^[0-9]+,?[0-9]+?$", but I cannt validate correctly my number.
Thanks!
Discussion posts and replies are publicly visible
This should do what you want:
^[0-9]+(\.|\,)[0-9]{2}$
Note that a decimal separator of , or . is acceptable. You can test this out using regexr, a useful regex tool: https://regexr.com/4chm4