programer.tips, another cool thing from @nghuuphuoc!

numeric validator

Check if the value is numeric

Validators

Improve it on Github

Options

Option HTML attribute Type Description
separator data-bv-numeric-separator String The decimal separator. Can be a dot (.) default or comma (,)
message data-bv-numeric-message String The error message
When setting options via HTML attributes, remember to enable the validator by setting data-bv-numeric="true".
You don't need to do that when
i) using HTML 5 type="number" attribute,
ii) and the step attribute must be specified which its value is not an integer

Related validators

The following validators might be useful to you: