![]() Some other countries have a similar system, where fractions of their main unit have a different name (pence, kopeks, etc.), and some countries call all of their units the same thing (pesos, rupees, etc.). With younger students, this is a good opportunity to talk about what we call fractions of a dollar (i.e., we would usually say 53 cents instead of $0.53). dollars?” With an exchange rate of 19 pesos to one dollar as of October 2017, we find that 10 divided by 19 is $0.53 USD. “If you were in Mexico and wanted to buy a cool soft drink for 10 pesos, how much would that be in U.S. This means we would divide 400 by 14 to find out what the equivalency would be in U.S. dollars?” In October 2017, the exchange rate is about 14 rand to one dollar. For example, “If you were in South Africa and wanted to buy a t-shirt for 400 rand, how much would that be in U.S. ![]() Help students work through the math of various currencies. Find a few examples to show students some current exchange rates- XE Currency Converter is a one source for current information. Exchange rates vary depending on many different factors, including politics and world events. Michigan State University Extension’s 4-H Youth Development has an activity for youth to figure out exchange rates themselves.Ĭountries establish an exchange rate for their money, which tells everyone how much one currency is equal to how much of another currency. This is a great time to talk about currency exchange and demystifying the math that goes into it. If you do so then you have to modify the JavaScript codes accordingly.After talking about how other countries have different money than us in “ Money around the world – Part 1: Foreign currency,” some kids may wonder how we buy and sell between countries. You can also use any other site API for this project. You can get this key from the official ExchageRateAPI site for free. zip file will be downloaded then you’ve to extract it.Īfter extracting the file, open the JavaScript file and pass your API key in the API URL. If your code doesn’t work or you’ve faced any error/problem, please download the source code files from the given download button. That’s all, now you’ve successfully built a Currency Converter App in HTML CSS & JavaScript. select-box select::-webkit-scrollbar-track` ĮxchangeRateTxt.innerText = "Something went wrong" * Import Google Font - Poppins 0 īox-shadow: 7px 7px 20px rgba(0, 0, 0, 0.05) Second, create a CSS file with the name of style.css and paste the given codes in your CSS file. Ĭurrency Converter App in JavaScript | CodingNepal You can also download the source code files of this Currency Converter from the given download button.įirst, create an HTML file with the name of index.html and paste the given codes in your HTML file. After creating these files just paste the following codes into your file. First, you need to create four Files: HTML, CSS & JavaScript Files. To create this project (Currency Converter in JavaScript). You might like this:Ĭurrency Converter App in JavaScript For flags, I used countryflags.io API to show the user-selected country flag. Once it’s done, for swapping the currency codes, I just reversed the “from” currency to “to” currency and then call the function. API returned an object of the all-country currency conversion rate of the user-selected “from” currency.įirst, I got the user selected “to” currency conversion rate, and then I calculate it with the user-entered amount and show it in the exchange rate text. Then I sent a get request to an exchange rate API by passing the user selected “from” currency code. Then in the script.js file, first, I created an options tag and added those currency codes inside each option tag using for-in loop and inserted these tags inside the select tag.Īfter this, I created a function and got the user-entered amount. In the JavaScript file (country-list.js), I stored all possible country code and their currency code as an object. Codes & Concepts Behind JavaScript Currency Converter App But before you go to copy-paste codes or download source files, let’s understand the main code and concepts behind creating this project. If you liked this JavaScript Currency Converter and want to get source codes or files, then you can get it from the bottom of this page. I hope you liked this project and also understood the codes. I tried to explain the main JavaScript line by written comments. In the video, you have seen the demo video of this currency converter and how I created it using HTML CSS & JavaScript.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |