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

Doesn't work with other inputs #5

Open
Failton opened this issue Nov 9, 2022 · 2 comments
Open

Doesn't work with other inputs #5

Failton opened this issue Nov 9, 2022 · 2 comments

Comments

@Failton
Copy link

Failton commented Nov 9, 2022

Hello!

With the data that I took from the webarchive, the program works fine. But if I change the input to (remove extra pairs):
{
"JPY_EUR": "0.0086356",
"EUR_JPY": "134.9401477"
}
then the program print:
No opportunity here :(

But it should print:
Starting with 100 in b'JPY'
b'JPY' to b'EUR' at 0.0086356 = 0.86356
b'EUR' to b'JPY' at 134.9401477 = 116.52891394781201

Starting with 100 in b'EUR'
b'EUR' to b'JPY' at 134.9401477 = 13494.014770000002
b'JPY' to b'EUR' at 0.0086356 = 116.52891394781201

@elmagow
Copy link

elmagow commented Dec 22, 2022

I don't have the same problem.
But I have an issue with the b'JPY' etc, we shouldn't get that b and I can't figure why it happens.

@elmagow
Copy link

elmagow commented Dec 24, 2022

Well, I found the solution. We have to remove the encode:

from_rate = matches.group(1).encode('ascii', 'ignore') to_rate = matches.group(2).encode('ascii', 'ignore')

from_rate = matches.group(1) to_rate = matches.group(2)

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

2 participants