See also: fvFloat

Function used to determine whether the passed value is a float.

Syntax

JSV_fsFloat(expV)

Prototype

n/a

Returns

The fsFloat function returns VALID if expV is a valid floating point value, EMPTY if expV is empty; otherwise, INVALID.


Parameters

The fsFloat function uses the following arguments.

Argument Description
expV The information in the field (i.e., object.value).

Remarks

n/a

Dependencies

JSV_isWhitespace, JSV_isFloat

Example

The following lines of code

function CheckField() {
    var isFP = JSV_fsFloat(document.FloatingPointForm.MyFloat.value);
    if (isFP == EMPTY)
        alert("This field DOES NOT contain a floating point number.");
    else if (isFP == INVALID)
        alert("This field contains an INVALID floating point number.");
    else 
        alert("This field contains a VALID floating point number.");
}

<FORM NAME="FloatingPointForm">
<B>Floating Point Number:</B>
<INPUT TYPE="Text" NAME="MyFloat" SIZE="8" MAXLENGTH="8">
<INPUT TYPE="Button" NAME="FloatCheck" VALUE="Check" onClick="CheckField();">
</FORM>

produce

Enter a floating point number and click the Check button.

Floating Point Number: