Function round

  • Computes number rounded to precision.

    Parameters

    • num: number

      The number to round down.

    • precision: number = 0

      The precision to round down to.

    Returns number

    Returns the rounded down number.

    Since

    4.7.0

    Example

    round(4.006)
    // => 4

    round(4.006, 2)
    // => 4.01

    round(4060, -2)
    // => 4100