logaretm / vee-validate

✅ Painless Vue forms
https://vee-validate.logaretm.com/v4
MIT License
10.79k stars 1.26k forks source link

Numeric validation does not allow negative numbers #1297

Closed MeltedFreddo closed 6 years ago

MeltedFreddo commented 6 years ago

Versions:

Description:

Any attempt to use a negative number will fail if using the numeric validation rule.

Steps To Reproduce:

Go to https://baianat.github.io/vee-validate/guide/rules.html#numeric and enter "-1"

logaretm commented 6 years ago

Numeric rule means that the input can only consist of numbers but doesn't take into account that the input sign. There's another rule for that, like integer.

MeltedFreddo commented 6 years ago

@logaretm Then it's not numeric validation, merely character validation. Either it should take into account the '-' sign or the validation rule is not correctly named. Your suggestion of 'integer' would not be an appropriate choice either as -1.234 should pass being evaluated as 'numeric' but fail 'integer'.

StephenWall commented 5 years ago

@MeltedFreddo "-1.234" can be validated by the "decimal" rule. I agree the name for "numeric" is slightly misleading, but "digits" already serves another purpose, and "integer" and "decimal" support signed numbers.

vstyler96 commented 5 months ago

@MeltedFreddo "-1.234" can be validated by the "decimal" rule. I agree the name for "numeric" is slightly misleading, but "digits" already serves another purpose, and "integer" and "decimal" support signed numbers.

there's no decimal validation rule for v4.x