diff --git a/nomadnet/ui/textui/Browser.py b/nomadnet/ui/textui/Browser.py index 88d467c..ee71f42 100644 --- a/nomadnet/ui/textui/Browser.py +++ b/nomadnet/ui/textui/Browser.py @@ -452,6 +452,10 @@ def size_str(num, suffix='B'): for unit in units: if abs(num) < 1000.0: - return "%3.2f %s%s" % (num, unit, suffix) + if unit == "": + return "%.0f%s%s" % (num, unit, suffix) + else: + return "%.2f%s%s" % (num, unit, suffix) num /= 1000.0 - return "%.2f %s%s" % (num, last_unit, suffix) \ No newline at end of file + + return "%.2f%s%s" % (num, last_unit, suffix) \ No newline at end of file