Javascript examples for Data Type:Float
Difference between parseFloat and parseInt
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//w w w.j ava2s. c o m var x = -0.15; console.log('using parseFloat', parseFloat(x) < 0); console.log('using parseInt', parseInt(x) < 0); } </script> </head> <body> </body> </html>