codetrix - v1.5.0
    Preparing search index...

    Function roundTo

    • Rounds a number to a specific number of decimal places.

      Parameters

      • value: number

        The number to round.

      • decimals: number = 0

        The number of decimal places.

      Returns number

      The rounded number.

      roundTo(3.14159, 2); // 3.14