Determines whether or not passed value is an floating point number.

Syntax

JSV_isFloat(expF)

Prototype

n/a

Returns

The isFloat function returns true if the expression expF contains is a floating point value; otherwise, false.

Parameters

The isFloat function uses the following arguments.

Argument Description
expF Value that is to be evaluated to see if it is a floating point number.

Remarks

Allowable values in a floating point number include '-', '.', and the digits 0 through 9. This function assumes that a floating point number contain a decimal point; otherwise, it is an integer.

Dependencies

JSV_toString, JSV_occurs, JSV_stripCharacters

Example

The following lines of code

var f = 54.87;
document.write( "The number " + f + " is a float? " + JSV_isFloat(f) );
f = 54;
document.write( "The number " + f + " is a float? " + JSV_isFloat(f) );
f = 0.54;
document.write( "The number " + f + " is a float? " + JSV_isFloat(f) );

produce