Math.trunc()
Math.trunc() is a JavaScript method in the Math category. Truncates the decimal part, returning the integer. The syntax is Math.trunc(x). A typical example: Math.trunc(1.9) // 1. A close sibling is Math.abs(), which returns the absolute value of a number. A close sibling is Math.ceil(), which rounds up to the nearest integer. A close sibling is Math.floor(), which rounds down to the nearest integer. A close sibling is Math.round(), which rounds to the nearest integer. More about this category: Math functions for calculations — random, round, sqrt, floor, and more. Related Math methods: Math.abs(), Math.ceil(), Math.floor(), Math.round(), Math.max(), Math.min(), Math.random(), Math.sqrt(). This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls. You can try Math.trunc() immediately in the JavaScript playground, look up unfamiliar terms in the glossary, or return to the JS Reference homepage.