From a3068da8650de0aa9a779fa22c4cdeea7aeb9bef Mon Sep 17 00:00:00 2001 From: Peter Bieringer Date: Thu, 26 Mar 2026 07:53:23 +0100 Subject: [PATCH] utils: improve format_unit --- radicale/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/radicale/utils.py b/radicale/utils.py index d25e08e0..ca4da132 100644 --- a/radicale/utils.py +++ b/radicale/utils.py @@ -378,7 +378,10 @@ def format_unit(value: float, binary: bool = False) -> str: unit = "k" else: unit = "" - return ("%.1f %s" % (value, unit)) + if unit == "": + return ("%d" % value) + else: + return ("%.1f %s" % (value, unit)) def limit_str(content: str, limit: int) -> str: