NewOldMax / react-form-validator-core

Core validator component for react forms
MIT License
94 stars 44 forks source link

isFloat not allowing negative numbers #35

Closed kizaonline closed 5 years ago

kizaonline commented 5 years ago

The isFloat validation rule is not allowing negative numbers, is this correct behaviour?

Comparing to isNumber, it appears isFloat is deliberately not allowing -:

isNumber: value => validations.matchRegexp(value, /^-?[0-9]\d*(\d+)?$/i),

isFloat: value => validations.matchRegexp(value, /^(?:[1-9]\d*|0)?(?:\.\d+)?$/i),
NewOldMax commented 5 years ago

closed via #36