Function round

    • Round number to precision
    • 将数字四舍五入到指定精度

    Parameters

    • num: number

      Number

    • Optional precision: number = 0

      Precision

    Returns number

    rounded number

    Example

    round(120.4321)
    //=120

    round(120.4321, 2)
    //=120.43

Generated using TypeDoc