30.9150.575 5// For full API documentation, including code examples, visit Velo API Reference - Wix.com
export function convertCurrency_click(event, $w) {
//Add your code for this event here:
var url = ‘https://api.fixer.io/latest?base=’;
var country = $w(“#amountConvert”).value;
var fullUrl = url + country;
var symbol = $w(“#amountConvert2”).value;
fullUrl = fullUrl + ‘&symbols=’ + symbol;
fetch(fullUrl, {method: ‘get’})
.then(response => response.json())
.then(json => $w(“#resultCurrency”).text = ((json.rates[symbol]*$w(“#inputAmount”).value).toFixed(2)).toString());
}
