API Changes - convertCurrency
This commit is contained in:
parent
6f78363db8
commit
dd212a0ac1
@ -178,10 +178,10 @@ function getRandomQuote() {
|
||||
}
|
||||
|
||||
// Convertis des euros (€) dans une autre devise
|
||||
function convertCurrency(urlFixerIO, currency, euroValue) {
|
||||
function convertCurrency(currency, euroValue) {
|
||||
$.ajax({
|
||||
url : urlFixerIO,
|
||||
dataType : "jsonp",
|
||||
url : 'https://api.exchangeratesapi.io/latest',
|
||||
dataType : "json",
|
||||
success: function (jsonFixer) {
|
||||
switch(currency) {
|
||||
case '£':
|
||||
|
@ -175,8 +175,7 @@ $(function () {
|
||||
else
|
||||
{
|
||||
euroValue = parseFloat(euroValue);
|
||||
let urlFixer = 'http://data.fixer.io/api/latest?access_key=' + config.APIkeyFixer;
|
||||
convertCurrency(urlFixer, euroToCurrency, euroValue);
|
||||
convertCurrency(euroToCurrency, euroValue);
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user