contents   index   previous   next



global.parseFloat()

syntax:

parseFloat(str)

where:

str - to be converted to a decimal float.

 

return:

number - the float to which the string converts, else NaN.

 

description:

This method is similar to global.parseInt() except that it reads decimal numbers with fractional parts. In other words, the first period, ".", in the parameter string is considered to be a decimal point, and any following digits are the fractional part of the number. The method parseFloat() does not take a second parameter.

 

see:

global.parseInt()

 

example:

var i = parseInt("9.3");

 


global.parseInt()