For a script I\'m writing, I need display a number that has been rounded, but not the decimal or anything past it. I\'ve gotten down to rounding it to the third place, but I
Math.trunc() function removes all the fractional digits.
For positive number it behaves exactly the same as Math.floor():
console.log(Math.trunc(89.13349)); // output is 89
For negative numbers it behaves same as Math.ceil():
console.log(Math.trunc(-89.13349)); //output is -89