• Format a number in millions.

    Example

    formatMillions(1_555_000) // "1.56"
    formatMillions(1_555_000, { minimumFractionDigits: 3 }) // "1.555"

    Returns

    Formatted number (as string)

    Parameters

    • value: number

      Number to format

    • Optional places: number

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

    Returns string

  • Parameters

    • value: number
    • Optional options: NumberFormatOptions

    Returns string

Generated using TypeDoc