• Format a percentage representation of a number.

    The number is multiplied by 100 to create a percentage.

    Example

    formatPercent(0.85)      // 85%
    formatPercent(0.1234) // 12%
    formatPercent(0.8567, 2) // 85.67%

    Returns

    Formatted percentage (as string)

    Parameters

    • value: number

      Number to format

    • Optional places: number

      (optional) Number of decimal places to round to (defaults to 0)

    Returns string

  • Parameters

    • value: number
    • Optional options: NumberFormatOptions

    Returns string

Generated using TypeDoc