From 933f6efd2dc043d3cb79aefc9959c5830eff5500 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Wed, 8 Mar 2023 22:57:15 +0100 Subject: [PATCH] percentage --- catcli/noder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/catcli/noder.py b/catcli/noder.py index c6390fe..24e7b28 100644 --- a/catcli/noder.py +++ b/catcli/noder.py @@ -438,7 +438,9 @@ class Noder: sztotal = size_to_str(node.total, raw=raw) szused = size_to_str(node.total - node.free, raw=raw) nbchildren = len(node.children) - pcent = node.free * 100 / node.total + pcent = 0 + if node.total > 0: + pcent = node.free * 100 / node.total freepercent = f'{pcent:.1f}%' # get the date timestamp = ''