From 1979e3238c32813384e33d755ba4bcf38922006f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 17 Dec 2018 10:42:30 +0100 Subject: [PATCH] Fix rounding --- htdocs/expensereport/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 082cccc6868..b5e8ed8151e 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1953,13 +1953,14 @@ else $totalpaid += $objp->amount; $i++; } + $totalpaid = price2num($totalpaid); // Round $totalpaid to fix floating problem after addition into loop if ($object->paid == 0) { print ''.$langs->trans("AlreadyPaid").':'.price($totalpaid).''; print ''.$langs->trans("AmountExpected").':'.price($object->total_ttc).''; - $remaintopay = $object->total_ttc - $totalpaid; + $remaintopay = price2num($object->total_ttc - $totalpaid); print ''.$langs->trans("RemainderToPay").':'; print ''.price($remaintopay).'';