@bates-solutions/stripe API Reference - v2.2.1
    Preparing search index...

    Function formatMoney

    • Format money for display.

      Converts with fromMinor, then formats with Intl.NumberFormat, which picks the display decimals for the currency (e.g. none for jpy and isk, three for kwd).

      Parameters

      • minor: number

        Amount in the smallest currency unit

      • currency: CurrencyCode = 'usd'

        Currency code, any case (default: usd)

      • locale: string = 'en-US'

        Locale for formatting (default: en-US)

      Returns string

      Formatted currency string

      If currency is not a non-empty string

      formatMoney(1050) // "$10.50"
      formatMoney(1000, 'jpy', 'ja-JP') // "¥1,000"
      formatMoney(5120, 'kwd') // "KWD 5.120"