numeric
Validates that a field contains a numeric value, with support for custom thousand and decimal separators.
Options
| Option | Type | Default | Description |
|---|---|---|---|
thousandsSeparator | string | "" | Character used as thousands separator (e.g. ",") |
decimalSeparator | string | "." | Character used as decimal separator |
message | string | locale default | Custom error message |
Playground
Valid values
| Value | Notes |
|---|---|
"1234.56" | Standard decimal |
"1,234.56" | With thousands separator |
"-42" | Negative number |
Invalid values
| Value | Reason |
|---|---|
"abc" | Not a number |
"1.234,56" | Separators swapped without reconfiguring |
Notes
- Empty string (
"") always returnsvalid: true— validators only run on non-empty values. Combine withnotEmptyto require a value. - For European format, use
thousandsSeparator: "."anddecimalSeparator: ",".