Function increaseByPercentage

  • Increase a number by given percentage

    Parameters

    • value: string | number | bigint

      The number to increasea

    • percentage: string | number

      The percentage to increase by

    • decimals: number

      The decimals of the value.

    Returns bigint

    The increased number (e.g. 100 + 10% of 100 = 110)

    Example

    increaseByPercentage('100', 10, 2) // 110
    increaseByPercentage('100', 25, 2) // 125
    increaseByPercentage(-100, 50, 9) // -50