Subscribe for notification

 

NathTech’s Tools ,

 

Currency Converter ,

This tool provides an interface for a Currency Convert  with input fields for entering the amount and selecting the currencies to convert from and to. After clicking the “Convert” button, the converted amount is displayed below the button. The exchange rates are fetched from the ExchangeRate-API.

 

 

Currency Converter


if (isNaN(amount) || amount <= 0) { alert('Please enter a valid amount.'); return; } fetch(`https://api.exchangerate-api.com/v4/latest/${fromCurrency}`) .then(response => response.json()) .then(data => { const exchangeRate = data.rates[toCurrency]; const convertedAmount = amount * exchangeRate;

document.getElementById('result').innerHTML = `

${amount} ${fromCurrency} equals ${convertedAmount.toFixed(2)} ${toCurrency}

`; }) .catch(error => { console.error('Currency conversion error:', error); alert('An error occurred while fetching exchange rates.'); }); });

shmbhnthjh8

Music composer, blogger,website creator,freelancer

Recent Posts

Toncoin: Everything You Need to Know About the Future of this Unique Cryptocurrency

NathTech Guid,   Introduction to Toncoin (TON) Toncoin (TON) is the native cryptocurrency of The…

2 months ago

How to Get Naturally Glowing Skin: A Complete Guide for All Skin Types

NathTech Guide , Introduction: glowing skin is a reflection of overall health and self-care. While…

3 months ago

How to Get Glowing Skin: Essential Tips, Skin Care Components, and Protection Against Environmental Factors

NathTech Guid Introduction: Achieving glowing skin is a goal that many people aspire to, but…

3 months ago

Essential Components of Fitness: A Comprehensive Guide for All Ages

Nathtech Guideline , Introduction Maintaining fitness is crucial for a healthy and fulfilling life, regardless…

5 months ago

Maintaining Fitness Naturally: A Comprehensive Guide for All Ages

Nathtech Guideline ,   Introduction ; In today's fast-paced world, maintaining fitness is more than…

5 months ago

Unlocking Natural Fitness: Essential Tips for Every Age

Nathtech's Guideline ,     Introduction , In a world that is increasingly focused on…

5 months ago