Fix quantities with "Tausendertrennpunkt" in Spar

Didn't dare to ignore dots globally, as I discovered stuff like "500.000 GR" in
MPREIS data.

Fixes #71
This commit is contained in:
Matthias Hochsteger 2023-06-05 14:42:42 +02:00
parent e714d720b0
commit 11e40125f6

View File

@ -23,7 +23,7 @@ exports.getCanonical = function (item, today) {
else if (description.endsWith("im topf")) [quantity, unit] = [1, "kg"];
else [quantity, unit] = [1, "stk."];
} else {
const s = description.replace(" EINWEG", "").replace(" MEHRWEG", "").trim();
const s = description.replace(" EINWEG", "").replace(" MEHRWEG", "").trim().replace(".", "");
const q = utils.parseUnitAndQuantityAtEnd(s);
quantity = q[0];
unit = q[1];