Method Number.isFloat
Check whether a number is a float
-
Syntax
Boolean Number.isFloat()
This functions checks whther a number is an integer. 16.0 is considered to be an integer - Return value True if the number is a float; false otherwise
-
Examples
- To find out whether a variable is a float
// Declare variable var n = 16.0; // Output is false - .0 is considered an integer n.isFloat(); var n = 16.0008; // Output is true n.isFloat();
-
Download
Source
Unless otherwise noted all code in the JSLab Standard Library is licensed as GPLv3. See http://www.gnu.org/licenses/gpl.html for the entire license.
