How to remove the decimal from a number
- Previous Page Tree View
- Next Page Remove Attribute
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
Related Pages
Reference Manual:JavaScript Math.trunc() Method
- Previous Page Tree View
- Next Page Remove Attribute