@rvoh/dream
    Preparing search index...

    Function percent

    • Calculates the percentage from a numerator and denominator, optionally rounding to a specified precision.

      Examples: percent(1, 4) // 25 percent(1, 0) // 0 percent(1, 3, 4) // 33.3333

      Parameters

      • numerator: number

        The numerator value

      • denominator: number

        The denominator value

      • Optionalprecision: RoundingPrecision

        Optional number of decimal places to round to

      Returns number

      The percentage value, rounded if precision is provided