Function round

Rounds a number to a given precision

round(1.23) // 1
round(1.55) // 2
round(1.333, 2) // 1.33
round(1.2345, 3) // 1.234
  • Parameters

    • value: number

      value to round

    • Optionalprecision: number

      precision to round to

    Returns number