From 90ca66834bd9fafa8c35269278c09fed55721f1b Mon Sep 17 00:00:00 2001 From: Matthew Nickson Date: Sat, 30 Oct 2021 22:48:45 +0100 Subject: [PATCH] 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 --- resources/views/partials/bootstrap-table.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 1cce39f95..61ac230f6 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -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)); }