Global.parseFloat() : parseFloat : Global JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Global » parseFloat »

 

Global.parseFloat()









Syntax








paraseFloat(string)



The parseFloat() method is used to convert a string to a number.












<html>
    <body>
    <script language="JavaScript">
    <!--
    document.write("The string 1245.31 converted is" + parseFloat("1245.31""<br>");
    ifisNaN(parseFloat("test")) ){
       document.write("Cannot convert test string to a number.");
    }
    -->
    </script>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Global
» parseFloat