You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to get historic exchange rates for EUR and USD. When using EUR as base currency there appeared sometimes unrealistic high values for USD. I couldn't find the bug in the code base but this is the code in python 2.7 I've been using:
import datetime
c = CurrencyRates(force_decimal=False)
d = datetime.datetime(2018, 5, 1, 18, 36, 28, 151012)
for t in range(100):
try:
ex_rate= c.get_rate('EUR', 'USD', (d - datetime.timedelta(days=t)))
ex_rates = c.get_rates('EUR', (d - datetime.timedelta(days=t)))
if ex_rate > 1.6:
print ex_rate, ex_rates, d - datetime.timedelta(days=t)
except Exception, e:
print 'Exchange rate not available'
When using USD as base rate this error didn't appear.
The text was updated successfully, but these errors were encountered:
I've tried to get historic exchange rates for EUR and USD. When using EUR as base currency there appeared sometimes unrealistic high values for USD. I couldn't find the bug in the code base but this is the code in python 2.7 I've been using:
When using USD as base rate this error didn't appear.
The text was updated successfully, but these errors were encountered: