If look into native Math
object in JavaScript, you get the whole bunch of functions to work on numbers and values, etc...
Basically what you want to do is quite simple and native in JavaScript...
Imagine you have the number below:
const myValue = 56.4534931;
and now if you want to round it down to the nearest number, just simply do:
const rounded = Math.floor(myValue);
and you get:
56
If you want to round it up to the nearest number, just do:
const roundedUp = Math.ceil(myValue);
and you get:
57
Also Math.round
just round it to higher or lower number depends on which one is closer to the flot number.
Also you can use of ~~
behind the float number, that will convert a float to a whole number.
You can use it like ~~myValue
...