• Calculates the percentages for each part from total. When total is omitted, it is assumed that the total is the sum of the parts.

    Returns

    array of floating point percentages, e.g. [0.1, 0.02, 0.587] is equivalent to 10%, 2%, 58.7%

    Parameters

    • parts: number[]

      array of integer values

    • total: number = ...

      optional param to allow sum(parts) to be smaller than the total

    Returns Percent[]

Generated using TypeDoc