I know that I can round a number like this
var number = 1.3;
Math.round(number);
and the result I'm given is 1.
But how can I round a number to the next highest whole number? So round 1.3 to 2 instead of 1?
Use Math.ceil() instead. It rounds the number up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With