I have used ng-pattern
/^[0-9]{1,7}(\.[0-9]+)?$/
for validate latitude and longitude values, but this pattern is not allowing me to enter negative values.
Latitude and longitude values contains negative and decimal values Can you please suggest me one good ng-pattern for my requirements.
Example values are given below
234.546655
, 3.5766876
, 12345.766566
I need validation for this type values. It should allow negative,positive,decimal and all numbers
This is a complete answer: https://stackoverflow.com/a/18690202/6359058
For your example: [-+]? is required for either - or +
/^[-+]?[0-9]{1,7}(\.[0-9]+)?$/