| title | ms.custom | ms.date | ms.prod | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | f1_keywords | dev_langs | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parseFloat Function (JavaScript) | Microsoft Docs |
01/18/2017 |
windows-client-threshold |
|
language-reference |
|
|
|
a7d87a69-1919-4623-be85-972e6376dd2d |
14 |
mikejo5000 |
mikejo |
ghogen |
Converts a string to a floating-point number.
parseFloat(numString)
The required numString argument is a string that contains a floating-point number.
The parseFloat function returns a 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 function.
[!INCLUDEjsv1]
Applies To: Global Object