| parseFloat() This method is used to return a number representing the string passed as the parameter. The number can be an integer or a floating point number, and must begin with a number, or the result is NaN (Not A Number). Also, numbers beginning with a zero (0) will be treated as an octal (base 8) number. syntax: parseFloat(string) EXAMPLE document.write("The number 41565.21565, converted to a string, is " + parseFloat('41565.21565') ); This example converts the given string to a number representation, and will out put the parseFloat() value of '41565.21565' after the given text. |