Skip to content

leneffets/currency

Repository files navigation

Currency Converter

  1. Currency Conversion:

    • Convert prices from one currency to another.
    • Supports the following currencies:
      • PLN (Polish Zloty)
      • USD (US Dollar)
      • EUR (Euro)
      • JPY (Japanese Yen)
      • CHF (Swiss Franc)
      • GBP (British Pound)
      • CZK (Czech Koruna)
      • DKK (Danish Krone)
      • TRY (Turkish Lira)
      • SEK (Swedish Krona)
      • NOK (Norwegian Krone)
  2. Exchange Rate Updates:

    • Uses real API endpoint (https://api.frankfurter.dev/v2/rates) to get the latest exchange rates.
    • Displays the last updated time for the exchange rate.
  3. Optional Price per Weight Calculations:

    • Calculate price per kilogram when weight is provided
    • Compare products by weight (e.g., 200g vs 250g packages)
  4. Localization:

    • Automatically detects browser language and switches between English and German.
    • Localization data is stored in separate JSON files (locales/en.json and locales/de.json).
  5. Settings Persistence:

    • Saves selected source and target currencies in the browser using localStorage.
    • Restores saved settings when the page is reloaded.
  6. Responsive Design:

    • The application works seamlessly on both desktop and mobile devices.
  7. Offline Support:

    • Loads the exchange rate from local storage if the API call fails.

How to Use

  1. Select the current currency and the target currency.
  2. (Optional) Add a bank markup percentage to adjust the exchange rate (positive values reduce the rate, negative values increase it).
  3. Enter the price in the current currency.
  4. (Optional) Enter weight to calculate price per kilogram
  5. The app shows the price in the target currency
  6. Click the 🔄 button to fetch the latest exchange rates.
  7. Use the 🧹 button to reset all input fields while preserving your currency preferences.

Access the app directly from GitHub Pages:
👉 Currency Converter

Screenshot

image

Development Setup

  1. Clone the repository:
    git clone https://github.com/leneffets/currency.git

License

This project is licensed under the MIT License. See the LICENSE file for details.

Feedback and Contributions

Feel free to open issues or submit pull requests to improve this project. Your contributions are welcome!