How to remove the decimal from a number

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

Remove decimals

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

Example

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

Try It Yourself

Related Pages

Reference Manual:JavaScript Math.trunc() Method