Browse Source

Add generalised function for currency exchange

remotes/origin/feature/currency-exchange
Shivam Chaudhary 2 years ago
parent
commit
8da7e42336
  1. 10
      src/currencyExchange.c

10
src/currencyExchange.c

@ -13,3 +13,13 @@ float toGBP(float euro) {
return GBP; return GBP;
} }
float convert(float euro, int newCurrencyCode) {
switch(newCurrencyCode) {
case 1:
return ( euro * CURRENT_USD_RATE_OF_ONE_EURO );
case 2:
return ( euro * CURRENT_GBP_RATE_OF_ONE_EURO );
}
return -1;
}
Loading…
Cancel
Save