GarGerry commited on
Commit
aa9d6ee
·
verified ·
1 Parent(s): 228c131

Update script.js

Browse files
Files changed (1) hide show
  1. script.js +1 -1
script.js CHANGED
@@ -7,7 +7,7 @@ async function convertCurrency() {
7
 
8
  if (amount && fromCurrency && toCurrency) {
9
  try {
10
- const response = await fetch(`https://v6.exchangerate-api.com/v6/3ebe2ccf9eeea2aaef280201/latest/${fromCurrency}`);
11
  const data = await response.json();
12
  const rate = data.rates[toCurrency];
13
  const convertedAmount = (amount * rate).toFixed(2);
 
7
 
8
  if (amount && fromCurrency && toCurrency) {
9
  try {
10
+ const response = await fetch(`https://api.exchangerate-api.com/v4/latest/${fromCurrency}`);
11
  const data = await response.json();
12
  const rate = data.rates[toCurrency];
13
  const convertedAmount = (amount * rate).toFixed(2);