Fixed sumFormatterQuantity if using 1.234,56 fomat

Previously sumFormatterQuantity used the parseFloat to convert the
string purchase_cost to a floating point number. parseFloat does not
return the correct value when using the comma format. To fix this
sumFormatterQuantity now used the cleanFloat function to convert
purchase_cost to a float.

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
This commit is contained in:
Matthew Nickson 2021-10-30 22:48:45 +01:00
parent 8996c24d1f
commit 90ca66834b
No known key found for this signature in database
GPG key ID: BF229DCFD4748E05

View file

@ -639,7 +639,7 @@
return 'no quantity';
}
var total_sum = data.reduce(function(sum, row) {
return (sum) + (parseFloat(row["purchase_cost"])*row[multiplier] || 0);
return (sum) + (cleanFloat(row["purchase_cost"])*row[multiplier] || 0);
}, 0);
return numberWithCommas(total_sum.toFixed(2));
}