Currency Converter

Table of Contents

Technologies used -
Description

Introducing the Currency Converter, a user-friendly web application built with HTML, CSS, and JavaScript that allows users to convert various currencies effortlessly. With this tool, users can select a quantity and choose their desired currency from a dropdown list, including the Indian Rupee (INR), US Dollar (USD), and Euro (EUR). Upon submission, the app fetches real-time conversion rates from an external API, ensuring accurate and up-to-date results.

The Currency Converter is designed with simplicity and accessibility in mind. It features an intuitive navigation bar, allowing users to easily access different sections of the site, and a clear layout that highlights the input fields and output results. The converted values are displayed in a neatly organized table, providing a comprehensive view of the conversions, which enhances the overall user experience.

Highlighted Source Code
				
					const populate = async (value, currency) => {
    let myStr = "";
    url = "https://api.currencyapi.com/v3/latest?apikey=your_api_key&base_currency=" + currency;

    let response = await fetch(url);
    let rJson = await response.json();
    document.querySelector(".output").style.display = "block"; 

    for (let key of Object.keys(rJson["data"])) {
        myStr += `<tr>
            <td>${key}</td>
            <td>${rJson["data"][key]["code"]}</td>
            <td>${Math.round(rJson["data"][key]["value"] * value)}</td>
        </tr>`;
    }
    const tableBody = document.querySelector('tbody');
    tableBody.innerHTML = myStr;
}
				
			

Related Projects

Fun Project

Tic Tac Toe Game

The Interactive Tic Tac Toe Game is a classic two-player game implemented using HTML, CSS, and JavaScript. This engaging application

Read More »