How to round a number to the next integer in Node.js

1 Answer

0 votes
console.log(Math.ceil(0.001)); 
console.log(Math.ceil(9.00001)); 
console.log(Math.ceil(-1.0001)); 
console.log(Math.ceil(-7)); 
console.log(Math.ceil(-7.1)); 
console.log(Math.ceil(-7.9))
  
  
  
  
/*
run:
  
1
10
-1
-7
-7
-7
  
*/

 



answered Jun 9, 2022 by avibootz

Related questions

2 answers 150 views
2 answers 145 views
2 answers 157 views
1 answer 129 views
1 answer 123 views
123 views asked Jun 8, 2022 by avibootz
...