Library API
    Preparing search index...

    Function formatCurrency

    • Formats a numeric value as a localized currency string.

      Parameters

      • str: string | number

        The numeric value or string to format

      • scale: number = 2

        The maximum number of fractional digits (default: 2)

      • currency: string = 'AUD'

        The ISO 4217 currency code (default: 'AUD')

      • Optionallocale: string

        Optional locale string (defaults to system locale)

      Returns string

      The localized currency string

      formatCurrency(1234.5, 2, 'USD'); // '$1,234.50'