Skip to content

Easy concurrency unit converter for everyday usage made with just with Javascript and HTML

License

Notifications You must be signed in to change notification settings

leneffets/currency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Currency and Weight 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.exchangerate-api.com/v4/latest/) to get latest exchange rates
    • Displays the last updated time for the exchange rate.
  3. Weight-Based Price Calculations:

    • Calculate price per kilogram for a given weight.
    • Calculate price for a specific unit weight (e.g., 250g).
    • For example: compare prices in supermarket:
      • enter price in PLN
      • add weight for 200g in PLN
        • converts to kilogram price in EUR
      • add weight for 250g in EUR
        • converts to 250g price in EUR
  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.

How to Use

  1. Select the current currency and the target currency.
  2. Enter the price in the current currency.
  3. (Optional) Add the product's weight and a custom unit weight (e.g., 250g).
  4. The app will calculate:
    • Price in the target currency.
    • Price per kilogram (if weight is provided).
    • Price for the specified unit in target currency (if unit weight is provided).
  5. Click the 🔄 button to fetch the latest exchange rates.

Access the app directly from GitHub Pages:
👉 Currency and Weight 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!