I have in a variable in javascript the value:
<script>
var valor1 = "123.33";
</script>
I would like to remove .33, leave only 123. Given that this value is variable, it could be 1233.30, 1001.44, anyway ...
I have in a variable in javascript the value:
<script>
var valor1 = "123.33";
</script>
I would like to remove .33, leave only 123. Given that this value is variable, it could be 1233.30, 1001.44, anyway ...
var str = "123.33"; var res = str.split("."); alert(res[0]);
res [0] = 123