diff --git a/src/store/includes-labels.ts b/src/store/includes-labels.ts index 2fa07dae6f..a1dc16db30 100644 --- a/src/store/includes-labels.ts +++ b/src/store/includes-labels.ts @@ -125,8 +125,14 @@ export async function getPrice( const priceString = await extractPageContents(page, selector); if (priceString) { + const thousandsSeparator = + priceString.search(/\d+\.\d{3}|\d+,\d{2}$/) > -1 ? /\./g : /,/g; const price = Number.parseFloat( - priceString.replace(/\\.|\\,/g, '').match(/\d+/g)!.join('.') // eslint-disable-line + priceString + .replace(/\\/g, '') + .replace(thousandsSeparator, '') + .match(/\d+/g)! + .join('.') ); logger.debug('received price', price);