Home
Run >
<!DOCTYPE html> <html> <head> <!-- www.techstrikers.com --> <title>My first Javascript code</title> </head> <body bgcolor="#bnde45"> <fieldset> <legend>Javascript parseFloat Function</legend> <script> var obj1=new String("7893.23"); document.write(parseFloat(obj1)); document.write("</br>"); var obj1=new String("Value is 233"); document.write(parseFloat(obj1)); document.write("</br>"); var obj2=new String("NaN"); document.write(parseFloat(obj2)); document.write("</br>"); var obj3=new String(" 903 21"); document.write(parseFloat(obj3)); document.write("</br>"); var obj4=new Date(); document.write(parseFloat(obj4)); document.write("</br>"); </script> </fieldset> </body> </html>