Function round

  • round a value to the specified number of digit

    Parameters

    • num: number

      value to be rounded.

    • Optionaldec: number = 0

      number of decimal digit to be rounded to.

    Returns number

    rounded value

    // round a specific value to 2 digits
    math.round(10.33333, 2); // return 10.33