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 currency extracted in case of long strings containing "$" #48
Comments
I’m personally not sure this is something price-number should aim to address. It feels to me like the code calling price-parser here should be responsible of cleaning up what it passes to |
Makes sense. We will see what we can do. |
But then maybe price-parser shouldn't alter the original currency? |
I’m not sure that’s happening here, at least in the examples from the issue description, where there’s only the currency hint being passed, no original currency is specified otherwise. |
Sure, let us look a bit more into it and then we can decide if the fix makes sense in the context of price-parser. |
These examples:
All of them return
Price(amount=Decimal('180'), currency='$')
.From what I understand in the code, this happens in
_search_safe_currency
:Would it be in the scope of the library to match the currency more strictly?
This would cover the use-case when we are pretty sure that the currency hint is exact, not fuzzy.
The text was updated successfully, but these errors were encountered: