How to round up a number in Node.js

1 Answer

0 votes
console.log(Math.ceil(7.99)); 
console.log(Math.ceil(7.0009)); 
console.log(Math.ceil(7.1)); 
console.log(Math.ceil(-8.009)); 
console.log(Math.ceil(-8.99)); 
console.log(Math.ceil(-8.1)); 
 
    
    
    
/*
    
run:
    
8
8
8
-8
-8
-8
    
*/

 



answered Jun 8, 2022 by avibootz

Related questions

1 answer 224 views
1 answer 228 views
1 answer 207 views
1 answer 207 views
1 answer 223 views
1 answer 222 views
2 answers 280 views
...