@eroyeroy/utils - v0.1.0
    Preparing search index...

    Function percentageOf

    • Calculates what percentage value is of total. Returns 0 if total is 0.

      Parameters

      • value: number

        The partial value.

      • total: number

        The total value.

      Returns number

      percentageOf(25, 100) // => 25
      percentageOf(1, 4) // => 25
      percentageOf(5, 0) // => 0