amazon-wish-list
amazon-wish-list copied to clipboard
Returns incorrect price
Amazon returns price in this format 10.024.34
which is basically 10024.34
.
Something like this fixes it.
// using `10.024.34` as example
var centsIdx = result[2].lastIndexOf('.'); // 6
var wholes = result[2].substring(0, centsIdx).replace(/\./g, ''); // '10024'
var cents = result[2].substring(centsIdx); // '.34'
price = wholes + cents; // '10024.34'
On the other hand, you could probably expose let the users pass a function to parse various fields. Thanks for making this.