Determines if the specified variable (string or number) can be parsed as a number.
Parameters:
Name | Type | Description |
---|---|---|
number | ||
number | string | | The number variable to be checked. |
- Since
- 3.1.0
- Source
Returns:
Returns true if the specified variable is a number. Returns false otherwise.
- Type:
- boolean
Example
import { isNumber } from "@gravityforms/utils";
function Example() {
let isnum = isNumber( 1.25 ); //yes
isnum = isNumber( '3.5' ); //yes
isnum = isNumber( '$3.5' ); //no
}