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 = parseInt(a);
4alert(c);
5</script>
1var x = parseInt("1000", 10); // you want to use radix 10
2 // so you get a decimal number even with a leading 0 and an old browser ([IE8, Firefox 20, Chrome 22 and older][1])