How to check decimal value without using ng pattern in anuglarJs?

I want the validity of the decimal not to be equal to 0.5.05, as well as the natural number.

For the natural, I did not use this template /^[0-9]{1,7}$/.

What pattern will I use for decimal no and natural no together?

+3
source share
2 answers

I think this should work.         /^[0-9]{1,7}(\.[0-9]+)?$/

+9
source

Use /^-?[0-9]\d*(\.\d*)?$/

0
source

All Articles