amazon-wish-list icon indicating copy to clipboard operation
amazon-wish-list copied to clipboard

Returns incorrect price

Open dumptyd opened this issue 7 years ago • 0 comments

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.

dumptyd avatar Oct 08 '17 10:10 dumptyd