-2

I want to be able to round up a number to the nearest whole - for example, 4.1 would round to 5, 4 would stay as 4.

5.6 would round to 6, 5.01 would round to 6.00. any whole numbers would not round but stay the same.

1 Answers1

2

there is Math.ceil() function

console.log(Math.ceil(4.1))
Dominik Matis
  • 2,086
  • 10
  • 15