javascript Global parseFloat( )

parseFloat( )NN 2 IE 3 ECMA 1  

parseFloat(string)

  

Returns a number value (either an integer or floating-point number) of the numerals in the string passed as a parameter. The string value must at least begin with a numeral, or the result is NaN. If the string starts with numbers but changes to letters along the way, only the leading numbers are converted to the integer. Therefore, you can use the expression:

parseFloat(navigator.appVersion)

to extract the complete version number (e.g., 4.03) that leads the otherwise long string that is returned from that property.

If the converted value doesn't have any nonzero values to the right of the decimal, the returned value is an integer. Floating-point values are returned only when the number calls for it.

 
Parameters
 
  • Any string that begins with one or more numerals.
 
Returned Value

Number.


904,Nickname,Homepage or email,Comments here,Add comment