Math.round()
Math.round() is a JavaScript method in the Math category. Rounds to the nearest integer. The syntax is Math.round(x). A typical example: Math.round(1.5) // 2. Another practical use — Round to 2 decimals: const value = 3.14159 const rounded = Math.round(value * 100) / 100 console.log(rounded) // 3.14 The TypeScript signature is (x: number): number. 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.trunc(), which truncates the decimal part, returning the 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.trunc(), 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.