Currency Exchange¶
Overview¶
Unspend supports multiple currencies so that users can view their subscription spending in their preferred currency. Each user selects a default currency in Settings, and all invoice amounts are converted to that currency when displayed.
Supported Currencies¶
USD, AUD, CAD, CHF, EUR, GBP, INR, JPY, NOK, NZD, SEK, SGD
Rate Syncing¶
Exchange rates are fetched from the Frankfurter API every 6 hours as a background job.
- Rates are stored as USD-to-target-currency pairs (e.g., USD → EUR, USD → GBP)
- On the first sync, 10 years of historical rates are backfilled
- Subsequent syncs only fetch rates from the day after the most recent stored rate
- Each currency is synced independently — a failure for one currency does not block others
Conversion¶
All conversions use USD as an intermediate currency:
- USD → other: Multiply by the rate
- Other → USD: Divide by the rate
- Other → other: Convert to USD first, then to the target currency
The rate used is the most recent one available on or before the invoice date. If no rate exists within a 7-day window, an error is raised.
Display¶
Amounts are shown with the currency's symbol and appropriate formatting:
- Most currencies place the symbol before the amount (e.g., US$100, €100, £100)
- NOK and SEK place the symbol after the amount (e.g., 100 kr)
- Large values are abbreviated: amounts over 1,000 show as "1.5k", over 1,000,000 as "1.5M"
User Setting¶
Users select their default currency from the Settings page. This setting applies across the entire application — all amounts on the subscriptions dashboard, spend breakdowns, and monthly charts are converted to the selected currency.