scrapinghub / price-parser

Extract price amount and currency symbol from a raw text string
BSD 3-Clause "New" or "Revised" License
316 stars 50 forks source link

Negative price amount #33

Open rennerocha opened 4 years ago

rennerocha commented 4 years ago

This PR fixes #29 . It allows the return of negative amount values when needed.

rennerocha commented 4 years ago

@Gallaecio ,

Besides the fact that extract_price_text seems to be a public function, it is never mentioned in the docs, so only users that read the source code of the library would be using it in their project. In my opinion I may consider it as a private function (just rename it to _extract_price_text would be an acceptable solution).

However I understand your concern about changing something that may be backward incompatible (specially because I changed the return value of the function), so I renamed it to _extract_price_amount and made extract_price_text as before just using this new private function.

Please let me know if it is better now!

Thanks!