From fecf8caccf1d2c7bf14c025c53d295446bda0e61 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Tue, 18 Apr 2023 14:23:24 +0200 Subject: [PATCH] Round numbers instead of truncating --- nummi/main/templatetags/main_extras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nummi/main/templatetags/main_extras.py b/nummi/main/templatetags/main_extras.py index 1e0dbd3..acdcfe0 100644 --- a/nummi/main/templatetags/main_extras.py +++ b/nummi/main/templatetags/main_extras.py @@ -11,7 +11,7 @@ def value(val, pm=False, r=2): return mark_safe("–") _prefix = "" _suffix = " €" - _val = formats.number_format(val, r, use_l10n=True, force_grouping=True) + _val = formats.number_format(round(val, r), r, use_l10n=True, force_grouping=True) if val > 0: if pm: