NumericVal

February 3, 2026 ยท View on GitHub

  • NumericVal()

Validates whether the input is numeric.

v::numericVal()->assert(-12);
// Validation passes successfully

v::numericVal()->assert('135.0');
// Validation passes successfully

This validator doesn't validate if the input is a valid number, for that purpose use the Number validator.

Templates

NumericVal::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be numeric
inverted{{subject}} must not be numeric

Template placeholders

PlaceholderDescription
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Numbers
  • Types

Changelog

VersionDescription
3.0.0Templates changed
2.0.0Renamed from Numeric to NumericVal
0.3.9Created as Numeric

See Also