From d6f3e192158e838952f462114bb2457614bd4e9e Mon Sep 17 00:00:00 2001 From: Jakob Date: Mon, 23 Mar 2026 20:06:00 +0100 Subject: [PATCH] Fix summary calculations --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index ef904f0..7c05dd2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -193,9 +193,9 @@ impl PreparedCustomer { .map(|p| p.amount.parse::().unwrap()) .sum(); - let rounded_grand_total = grand_total.round(); - let avrundningsfel = grand_total - rounded_grand_total; - let oresutjamning = total_from_transactions - rounded_grand_total; + let avrundningsfel = total_from_transactions - grand_total; + let rounded_grand_total = total_from_transactions.round(); + let oresutjamning = rounded_grand_total - grand_total - avrundningsfel; let summary = Summary { total_volume: fmt(total_volume),