Skip to content

Math.round()

Description

Round the number value to the specified precision.

Syntax

JS
Math.round(value: Number, precision: Number) -> Number

Parameters

Parameter Type Description
value Number The number to be rounded.
precision Number The precision, the number of digits after the decimal point.

Return value

Type Description
Number The number rounded to the specified precision.

Example

JS
let p = Math.round(1.23456789, 3);
console.info(p);
Last update: 14 August 2025, 18:47