The parseFloat() function looks at each character starting in position 0. It continues to convert until it reaches either the end of the string or an invalid character. A decimal point is valid the first time not the second time.
document.writeln(parseFloat("12.34.5"));
The code above generates the following result.
12.34