How to round down a number in Node.js

1 Answer

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

 



answered Jun 8, 2022 by avibootz
...