NUMBER

Verifies if the input data is a valid number

Options
  • stringbooleanif specified, verifies if it is a string number. A string number contains only numbers, and will not be parsed, eg, 00304560
  • minnumberif specified, the minimum value of the number
  • maxnumberif specified, the maximum value of the number.
  • floatbooleanif specified, it will use parseFloat() in stead of parseInt()
'use strict';
thorin.validate('NUMBER', 'inputString', {
   min: 10,
   max: 100,
   float: true,
   string: false
});
Do you have a question or is something missing?

You can always create a new issue on GitHub or contact one of the core founders by chat.