number()
function number<TForm, TField>(fieldPath, options?): void;
Defined in: core/validation/validators/number.ts:28
Адаптер для number валидатора Проверяет, что значение является числом и соответствует заданным ограничениям
Type Parameters
TForm
TForm
TField
TField extends number | undefined = number
Parameters
fieldPath
FieldPathNode<TForm, TField, unknown> | undefined
options?
ValidateOptions & object
Returns
void
Example
number(path.age);
number(path.price, { min: 0, max: 1000000 });
number(path.percentage, { min: 0, max: 100, integer: true });
number(path.rating, { min: 0, max: 5, multipleOf: 0.5 });