From afe5575b34ef9398caf75eeb25f1a4851ddd6689 Mon Sep 17 00:00:00 2001 From: tcprod Date: Fri, 7 Feb 2025 18:57:07 +0100 Subject: [PATCH] Fix Decimal precision issue --- src/ez_lan_manager/services/AccountingService.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ez_lan_manager/services/AccountingService.py b/src/ez_lan_manager/services/AccountingService.py index ba70ebd..5970631 100644 --- a/src/ez_lan_manager/services/AccountingService.py +++ b/src/ez_lan_manager/services/AccountingService.py @@ -67,8 +67,7 @@ class AccountingService: @staticmethod def make_euro_string_from_decimal(euros: Decimal) -> str: """ - Internally, all money values are cents as ints. Only when showing them to the user we generate a string. - Prevents float inaccuracy. + Internally, all money values are euros as decimal. Only when showing them to the user we generate a string. """ rounded_decimal = str(euros.quantize(Decimal(".01"), rounding=ROUND_DOWN)) return f"{rounded_decimal} €"