How TO - Remove Decimals of a Number
Learn how to remove the decimal part of a number in JavaScript.
Remove Decimals
You can use the Math.trunc()
method to remove the decimals of a number:
Tip: Learn more about the Math.trunc() method in our JavaScript Reference.