How to remove decimal from numbers

Learn how to remove the decimal part of a number in JavaScript.

Remove decimal

You can use Math.trunc() Method to remove decimal from numbers:

Example

let x = Math.trunc(8.7512356); // 8

Try It Yourself

Related Pages

Reference Manual:JavaScript Math.trunc() metode