Currency Converter
A currency converter calculates exchange rates between different currencies for travel, international business, and investment purposes. Exchange rates fluctuate based on economic factors, interest rates, and market conditions.
Major Currency Pairs
| Currency | Symbol | Description |
|---|---|---|
| USD | $ | US Dollar (base currency) |
| EUR | € | Euro (European Union) |
| GBP | £ | British Pound Sterling |
| JPY | ¥ | Japanese Yen |
| CAD | C$ | Canadian Dollar |
| AUD | A$ | Australian Dollar |
| CHF | Fr | Swiss Franc |
Currency Conversion Example
At exchange rates (example values):
| From USD | To EUR (0.92) | To GBP (0.79) | To JPY (149) |
|---|---|---|---|
| $100 | €92 | £79 | ¥14,900 |
| $500 | €460 | £395 | ¥74,500 |
| $1,000 | €920 | £790 | ¥149,000 |
| $5,000 | €4,600 | £3,950 | ¥745,000 |
Currency Converter Implementation
``javascript
function convertCurrency(amount, fromCurrency, toCurrency, rates) {
// Rates are relative to USD
const fromRate = rates[fromCurrency] || 1;
const toRate = rates[toCurrency] || 1;
// Convert to USD first, then to target
const inUSD = amount / fromRate;
const converted = inUSD * toRate;
return {
original: amount,
fromCurrency,
toCurrency,
converted: converted.toFixed(2),
rate: (toRate / fromRate).toFixed(4)
};
}
const rates = { USD: 1, EUR: 0.92, GBP: 0.79, JPY: 149, CAD: 1.36 };
console.log(convertCurrency(100, 'USD', 'EUR', rates));
// { original: 100, converted: '92.00', rate: '0.9200' }
``
Currency Exchange Tips
Bank and credit card rates are typically better than airport exchanges. Many cards offer no foreign transaction fees. Consider multi-currency accounts for frequent international travelers.