Export function to validate if a value is a number, or with special sign
- License:
- Source:
Example
import { isNumber } from 'itee-validators' if( isNumber( value ) ) { //... } else { //... }
Methods
-
<static> isFloat(data)
-
Check if given data is a floating point number
Parameters:
Name Type Description data
* The data to check against the floating point - Source:
Returns:
true if data is a float, false otherwise- Type
- boolean
-
<static> isInteger(data)
-
Check if the given data is an integer number
Parameters:
Name Type Description data
* The data to check against the integer state - Source:
Returns:
true if data is an integer, false otherwise- Type
- boolean
-
<static> isNaN(data)
-
Check if given data is not a number
Parameters:
Name Type Description data
* The data to check against the NaN state Returns:
true if data is not a number, false otherwise.- Type
- boolean
-
<static> isNotNumber(data)
-
Check if given data is not a number
Parameters:
Name Type Description data
* The data to check against the number type - Source:
Returns:
true if data is not of type number or not a number, false otherwise.- Type
- boolean
-
<static> isNumber(data)
-
Check if given data is a number
Parameters:
Name Type Description data
* The data to check against the maximum safe integer state - Source:
Returns:
true if data is a number, false otherwise.- Type
- boolean
-
<static> isNumberNegative(data)
-
Check if the data is a negative number
Parameters:
Name Type Description data
* The data to check against the negativity - Source:
Returns:
true if data is a negative number, false otherwise.- Type
- boolean
-
<static> isNumberPositive(data)
-
Check if the data is a positive number
Parameters:
Name Type Description data
* The data to check against the positivity - Source:
Returns:
true if data is a positive number, false otherwise.- Type
- boolean