diff --git a/receipt/index.php b/receipt/index.php index 3a3b242..53d97dc 100644 --- a/receipt/index.php +++ b/receipt/index.php @@ -91,10 +91,10 @@ foreach ($parentItems as $parent) { $qty = (int) $parent['Quantity']; if ((int) $parent['CategoryID'] !== 31) { - $payfritsCut += $price * $qty * (float) $order['PayfritFee']; + $payfritsCut += round($price * $qty * (float) $order['PayfritFee'], 2); } - $lineTotal = $price * $qty; + $lineTotal = round($price * $qty, 2); $cartGrandTotal += $lineTotal; $itemRows .= ''; @@ -116,7 +116,7 @@ foreach ($parentItems as $parent) { foreach ($children as $child) { $modParent = queryOne("SELECT Name FROM Items WHERE ID = ?", [(int) $child['ParentItemID']]); $modParentName = $modParent['Name'] ?? ''; - $modTotal = (float) $child['Price'] * $qty; + $modTotal = round((float) $child['Price'] * $qty, 2); $cartGrandTotal += $modTotal; $itemRows .= '';