If percent > 0, even if it's very small, render some little sliver of
authorScott <[email protected]>
Mon, 31 Jan 2022 17:13:00 +0000 (09:13 -0800)
committerScott <[email protected]>
Mon, 31 Jan 2022 17:13:00 +0000 (09:13 -0800)
a bar.

text_utils.py

index cfed1699dc3f29090a7846bff8dc2d3c89fa9174..741e2a30dacd94306ac79a9c1cce4cc416b67e3f 100644 (file)
@@ -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)