Namespace: Basic:isFloat

Basic:isFloat

Source:

Methods

isFloat(floatVal) → {Boolean}

Returns if a value is a numeric value, usable as a float number in any calculation. Any number that fulfills isInt, is also considered a valid float, which lies in JS's nature of not differentiating ints and floats by putting them both into a "number"-type. So ints are always floats, but not necessarily the other way round.

Parameters:
Name Type Description
floatVal *

the value to check

Source:
Returns:
true if floatVal is usable in a float context
Type
Boolean
Example
if( !isFloat(val) ){
  alert('val can not be calculated with!');
}