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
|
// Convertis des euros (€) dans une autre devise
|
||||||
function convertCurrency(urlFixerIO, currency, euroValue) {
|
function convertCurrency(currency, euroValue) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : urlFixerIO,
|
url : 'https://api.exchangeratesapi.io/latest',
|
||||||
dataType : "jsonp",
|
dataType : "json",
|
||||||
success: function (jsonFixer) {
|
success: function (jsonFixer) {
|
||||||
switch(currency) {
|
switch(currency) {
|
||||||
case '£':
|
case '£':
|
||||||
|
@ -175,8 +175,7 @@ $(function () {
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
euroValue = parseFloat(euroValue);
|
euroValue = parseFloat(euroValue);
|
||||||
let urlFixer = 'http://data.fixer.io/api/latest?access_key=' + config.APIkeyFixer;
|
convertCurrency(euroToCurrency, euroValue);
|
||||||
convertCurrency(urlFixer, euroToCurrency, euroValue);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user