Function formatWithComma

  • Add Comma to a number or amount string (e.g. 1000000 to 1,000,000)

    Parameters

    • amount: string | number | bigint

    Returns string

    Example

    formatWithComma(1000000) // '1,000,000'
    formatWithComma('1000.34') // '1,000.34'