@rvoh/dream
    Preparing search index...

    Function round

    • Rounds a number to a specified decimal precision.

      Examples: round(0.5, 0) // 1 round(0.4, 0) // 0 round(0.15, 1) // 0.2 round(0.14, 1) // 0.1 round(0.1234, 2) // 0.12

      Parameters

      • num: number

        The number to round

      • precision: RoundingPrecision = 0

        The number of decimal places to round to (default: 0)

      Returns number

      The rounded number