Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

JScript Global Object parseFloat Method

Converts strings into floating point numbers.

Syntax: JScript Global Object parseFloat Method

parseFloat(numstring)

Arguments: JScript Global Object parseFloat Method

numstring

A string that contains a floating point number.

Remarks: JScript Global Object parseFloat Method

The parseFloat method returns an numerical value equal to the number contained in numstring. If no prefix of numstring can be successfully parsed into a floating-point number, NaN (not a number) is returned.

parseFloat("abc") // Returns NaN.

parseFloat("1.2abc") // Returns 1.2.

You can test for NaN using the isNaN method.

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.