drawrowfly / amazon-product-api

Amazon Scraper. Scrape products from the amazon search result or reviews from the specific product
631 stars 181 forks source link

Parsing money. Now it should work in any currency #8

Closed linconrezende closed 4 years ago

linconrezende commented 4 years ago

Hi, I created pull request here by mistake, however I managed to fix the money format with comma. In my country numbers can be like this: '1.999,99'. I was having a NaN value because there wasn't a parseFloat on the variable. And parse float works with DOT separator, not comma, so I first had to remove the dot then replace the comma :D Here it's working, it's not a pretty core, it could be much better with regexp.