diff --git a/python/currency-exchange/exchange.py b/python/currency-exchange/exchange.py index 5880035..9503c18 100644 --- a/python/currency-exchange/exchange.py +++ b/python/currency-exchange/exchange.py @@ -72,9 +72,8 @@ def exchangeable_value(budget, exchange_rate, spread, denomination): :return: int - maximum value you can get. """ - exchange = exchange_rate / 100 - cost = exchange - spread + rate = exchange_rate + exchange_rate * spread / 100 + new = exchange_money(budget, rate) + bill = get_number_of_bills(new, denomination) - result = budget - cost * denomination - - return result + return get_value_of_bills(denomination, bill)