Skip to content

roundToDecimalPlaces

roundToDecimalPlaces(number, places) → number · Math

Round a number to a specified number of decimal places.

  • number (required): the value to round

  • places (required): number of decimal places

utlx
roundToDecimalPlaces(3.14159, 3)         // 3.142
roundToDecimalPlaces(100.0, 0)           // 100

Released under AGPL-3.0.