Rounds a number to a specified number of decimal places using standard rounding rules (round half up).
The number to round.
The number of decimal places to round to.
The rounded number.
console.log(PUtilsNumber.round(3.14159)) // 3console.log(PUtilsNumber.round(3.14159, 2)) // 3.14console.log(PUtilsNumber.round(3.1459, 2)) // 3.15console.log(PUtilsNumber.round(123.456789, 4)) // 123.4568 Copy
console.log(PUtilsNumber.round(3.14159)) // 3console.log(PUtilsNumber.round(3.14159, 2)) // 3.14console.log(PUtilsNumber.round(3.1459, 2)) // 3.15console.log(PUtilsNumber.round(123.456789, 4)) // 123.4568
Rounds a number to a specified number of decimal places using standard rounding rules (round half up).