From: Scott <scott@wannabe.house>
Date: Mon, 31 Jan 2022 17:13:00 +0000 (-0800)
Subject: If percent > 0, even if it's very small, render some little sliver of
X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=9313acd7f50f19dfa3a3ff32f686c924b4cfe75a;p=python_utils.git

If percent > 0, even if it's very small, render some little sliver of
a bar.
---

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)