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

Prefer price number which is close to currency symbol #2

Open
kmike opened this issue Apr 17, 2019 · 0 comments · May be fixed by #5
Open

Prefer price number which is close to currency symbol #2

kmike opened this issue Apr 17, 2019 · 0 comments · May be fixed by #5
Labels
help wanted Extra attention is needed

Comments

@kmike
Copy link
Member

kmike commented Apr 17, 2019

Currently amount of items may be picked as a price, instead of the price number:

In [5]: Price.fromstring('3 Ausgaben für nur 14,85 EUR')
Out[5]: Price(amount=Decimal('3'), currency='EUR')

In [6]: Price.fromstring('Buy Now - 2 Litre Was $120.00 Now $60.00')
Out[6]: Price(amount=Decimal('2'), currency='$')

I think making price-parser to prefer numbers close to currency symbol (instead of taking the first one) may help to fix such cases - maybe not all of them, but at least some.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant