summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott <[email protected]>2022-01-31 09:13:00 -0800
committerScott <[email protected]>2022-01-31 09:13:00 -0800
commit9313acd7f50f19dfa3a3ff32f686c924b4cfe75a (patch)
treeb064f3d19ca615c3c823df50a66fbe7397387dfc
parent1a092f01f1a945a330fe19e96a8de507823fc28e (diff)
If percent > 0, even if it's very small, render some little sliver of
a bar.
-rw-r--r--text_utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/text_utils.py b/text_utils.py
index cfed169..741e2a3 100644
--- a/text_utils.py
+++ b/text_utils.py
@@ -87,6 +87,8 @@ def bar_graph(
if whole_width == width:
whole_width -= 1
part_char = "▉"
+ elif whole_width == 0 and percentage > 0.0:
+ part_char = "▏"
else:
remainder_width = (percentage * width) % 1
part_width = math.floor(remainder_width * 8)