How to remove the digits after the decimal point in TypeScript

1 Answer

0 votes
console.log(Math.trunc(3.14)); 
console.log(Math.trunc(32.0)); 
console.log(Math.trunc(-7.83476)); 

  
  
  
  
/*
run:
  
3 
32 
-7 
  
*/

 



answered Jun 14, 2022 by avibootz
...