diff --git a/src/currencyExchange.c b/src/currencyExchange.c index b3dc39a..2a22334 100644 --- a/src/currencyExchange.c +++ b/src/currencyExchange.c @@ -1,25 +1,13 @@ #include "currencyExchange.h" -float toUSD(float euro) { - - float USD = euro * CURRENT_USD_RATE_OF_ONE_EURO; - - return USD; -} - -float toGBP(float euro) { - - float GBP = euro * CURRENT_GBP_RATE_OF_ONE_EURO; - - 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 ); + case CURRENCY_CODE_USD: + return ( euro * USD_RATE_OF_ONE_EURO ); + + case CURRENCY_CODE_GBP: + return ( euro * GBP_RATE_OF_ONE_EURO ); } + return -1; } \ No newline at end of file