Overview
Currency conversion in Windows Calculator uses live exchange rate data from Bing to provide accurate, up-to-date conversions between world currencies.Developer Builds: Currency converter uses mock data with fictional planet names instead of real countries. This mock data remains static regardless of inputs and is clearly identifiable.
Features
Live Exchange Rates
Real-time rates from Bing (retail builds only)
Dual Conversion
Convert in both directions simultaneously
Cached Data
Works offline with last downloaded rates
Multiple Currencies
Support for major world currencies
Currency Data Management
Automatic Updates
The currency converter intelligently manages exchange rate data:- On First Use - Attempts to load from cache
- If Cache Miss - Downloads latest rates from Bing
- On Subsequent Uses - Checks cache freshness
- Auto-refresh - Updates when data is stale
src/CalcManager/UnitConverter.h:198-201
Manual Refresh
Click the refresh button to:- Force download of latest rates
- Update timestamp
- Refresh all displayed conversions
src/Calculator/Views/UnitConverter.xaml.cs:167-180
The refresh button is disabled while a refresh operation is in progress to prevent duplicate requests.
Network Behavior
The currency converter adapts to different network conditions:Network States
Normal Access
- Automatically downloads exchange rates
- Refreshes data as needed
- No user prompts required
src/Calculator/Views/UnitConverter.xaml.cs:254-267
Metered Connection (Opt-In)
- Prompts user before downloading
- Shows “Data charges may apply” warning
- User can click refresh to override and download
- Preference remembered for session
src/Calculator/Views/UnitConverter.xaml.cs:269-282
Offline Mode
- Uses cached exchange rates
- Shows offline indicator with timestamp
- Displays link to network settings
- No automatic refresh attempts
src/Calculator/Views/UnitConverter.xaml.cs:284-288
Currency Display
Currency Symbols
Currency symbols are displayed according to regional preferences:- Left-side - Symbol before amount (e.g., “$100”)
- Right-side - Symbol after amount (e.g., “100€”)
src/Calculator/Views/UnitConverter.xaml.cs:54-56
Exchange Rate Information
The converter displays:- Equality Statement - “1 USD = 0.85 EUR”
- Accessible Equality - Screen-reader friendly version
- Inverse Rate - Conversion in opposite direction
src/CalcManager/UnitConverter.h:194-195
Timestamp Display
Shows when exchange rates were last updated:- Normal font weight for recent data
- Bold font weight if data is more than a week old
- Absolute date/time stamp
src/Calculator/Views/UnitConverter.xaml.cs:336-346
Data Structure
Currency Static Data
Each currency contains:src/CalcManager/UnitConverter.h:143-150
Currency Ratio
Exchange rate information:src/CalcManager/UnitConverter.h:152-157
Callback Interface
The currency converter uses callbacks to update the UI:- CurrencyDataLoadFinished - Notifies when data loading completes
- CurrencySymbolsCallback - Updates currency symbols
- CurrencyRatiosCallback - Updates exchange rate display
- CurrencyTimestampCallback - Updates last refresh time
- NetworkBehaviorChanged - Handles network state changes
src/CalcManager/UnitConverter.h:166-175
Loading States
The converter provides visual feedback during operations:Progress Indication
- Progress ring appears after 500ms delay
- Prevents UI flicker for fast connections
- Cancels if data loads quickly
src/Calculator/Views/UnitConverter.xaml.cs:348-374
State Transitions
- Unit Not Loaded - Initial state or during refresh
- Loading - Progress ring visible
- Unit Loaded - Data available, conversion ready
- Failed - Error state with retry option
src/Calculator/Views/UnitConverter.xaml.cs:209-228
Error Handling
Network Errors
If rate download fails:- “Failed to refresh” message displayed
- Last cached rates still available
- Retry button enabled
- Error doesn’t prevent using cached data
src/Calculator/Views/UnitConverter.xaml.cs:330-334
Cache Failures
If cache is unavailable:- Attempts web download immediately
- Shows loading indicator
- Falls back to offline mode if both fail
Async Operations
Currency data loading uses async operations:- TryLoadDataFromCacheAsync() - Load from local cache
- TryLoadDataFromWebAsync() - Download from Bing
- TryLoadDataFromWebOverrideAsync() - Force download (metered override)
src/CalcManager/UnitConverter.h:198-200
Privacy & Telemetry
Currency conversion telemetry is disabled in developer builds by default. It can be enabled with the SEND_DIAGNOSTICS build flag.
Common Use Cases
- Travel planning - Convert home currency to destination currency
- International shopping - Compare prices across regions
- Foreign exchange - Calculate exchange rates for transactions
- Investment tracking - Monitor currency values
- Business calculations - International pricing and invoicing
Related Features
- Unit Converter - Main unit conversion interface
- Standard Calculator - Perform calculations on converted amounts