@tremendous/help
    Preparing search index...

    Function round

    • Rounds a number to a given decimal place.

      This function rounds a number to the specified number of decimal places. If the decimal parameter is not provided, it defaults to 2.

      Parameters

      • number: number

        The number to round.

      • Optionaldecimal: number = 2

        The number of decimal places to round to. Defaults to 2.

      Returns number

      • The rounded number.
      round(3.14159); // 3.14
      round(3.14159, 3); // 3.142
      round(3.14159, 0); // 3