Remove values after the period
Continue my project
I ran into this problem
I would like to delete the values after the dot,
Is there something to do this?
rightly the code will be adapted to uxp.
Continue my project
I ran into this problem
I would like to delete the values after the dot,
Is there something to do this?
rightly the code will be adapted to uxp.
OK, it would depend on the goal, one way is to parse the floating number as an integer:
var theValue = 52.51282051;
var theNewValue = parseInt(theValue);
alert(theValue + "\n" + theNewValue);
https://www.w3schools.com/jsref/jsref_parseint.asp
But you could have other goals, such as rounding up or down to the nearest integer?
EDIT:
The Math.abs() Method
The Math.ceil() Method
The Math.floor() Method
The Math.round() Method
The Math.fround() Method
The Math.trunc() Method
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.