-1
I have in a variable in javascript the value:
<script>
var valor1 = "123.33";
</script>
I would like to remove the . 33, leave only the 123. Taking into account that this value is variable, it can be 1233.30, 1001.44, finally...
-1
I have in a variable in javascript the value:
<script>
var valor1 = "123.33";
</script>
I would like to remove the . 33, leave only the 123. Taking into account that this value is variable, it can be 1233.30, 1001.44, finally...
8
Already have something ready tested that is the parseInt()
.
console.log(parseInt("123.33"));
1
var str = "123.33"; var res = str.split("."); alert(res[0]);
res[0] = 123
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.