Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong historic exchange rates with EUR as base #37

Closed
makemate opened this issue May 25, 2018 · 1 comment
Closed

Wrong historic exchange rates with EUR as base #37

makemate opened this issue May 25, 2018 · 1 comment
Assignees

Comments

@makemate
Copy link

makemate commented May 25, 2018

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.

@ravigadila ravigadila self-assigned this Jun 1, 2018
@ashwin31
Copy link
Member

ashwin31 commented Jun 9, 2018

@makemate this is fixed and verified.

@ashwin31 ashwin31 closed this as completed Jun 9, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants