Skip to content
Functionutilsv0.10.0

round

Rounds a number to a specified number of decimal places.

round(
    num: number,
    precision: number
): number
round(3.14159, 2); // 3.14
round(2.5, 0); // 3