1var myInt = parseInt("10.256"); //10
2var myFloat = parseFloat("10.256"); //10.256
1<script language="JavaScript" type="text/javascript">
2var a = "3.3445";
3var c = parseFloat(a);
4alert(c);
5</script>
6
1var myString = "869.99"
2var myFloat = parseFloat(myString)
3var myInt = parseInt(myString)
1var text = '42px';
2var integer = parseInt(text, 10);
3// returns 42
4let myNumber = Number("5.25"); //5.25