Currency Icon Helper
The currencyIcon helper converts an ISO 4217 currency code (like "USD", "EUR", "ILS") into its corresponding currency symbol.
Use this helper to display readable currency symbols in your document templates instead of plain currency codes.
Function name meaning (quick reference)
currencyIcon= take a currency code and return the currency symbol
Overview
The currencyIcon helper maintains an internal map of 160+ currency codes to their symbols. It's designed to be safe — it validates input and returns an empty string if the currency code is not found.
Basic usage
Scenario: Display an invoice total with the correct currency symbol.
Expected output (if CurrencyCode = "USD" and Amount = 1500):
$ 1500
Supported currencies
The helper supports all major ISO 4217 currency codes, including:
| Code | Symbol | Code | Symbol | Code | Symbol |
|---|---|---|---|---|---|
| USD | $ | EUR | € | GBP | £ |
| JPY | ¥ | ILS | ₪ | INR | ₹ |
| AUD | $ | CAD | $ | CHF | CHF |
| CNY | ¥ | RUB | ₽ | BRL | R$ |
| MXN | $ | SGD | S$ | HKD | $ |
| ... and 140+ more |
Common examples
Israeli Shekel with amount
Expected output:
₪ 2,500
Euro with decimal precision
Expected output (if Amount = 99.5):
€ 99.50
Dynamic currency from field
Expected output (if CurrencyCode = "GBP" and AnnualRevenue = 150000):
£ 150,000.00
Error handling
The helper safely handles invalid inputs:
- Non-string input → returns empty string
- Unknown currency code → returns empty string
- Empty input → returns empty string
Expected output:
(empty string)
Combining with number formatting
For professional financial documents, combine currencyIcon with number helpers:
Expected output (if PricingCurrency = "CHF" and Price = 3499.50):
CHF 3,499.50
Best practices
- Always validate the currency code exists before displaying to end users
- Pair with number formatting for professional-looking amounts
- Store currency codes as uppercase ISO 4217 codes (e.g., "USD" not "usd")
- Test with multi-language documents to ensure symbol encoding is correct
- Use in combination with currency formatting helpers like
currencyFormatNISfor localized output
Related helpers
- Number Helpers – Format numbers with decimal places and thousands separators
- Data Formats and Date Manipulation – Work with different data types and formats