]> git.armaanb.net Git - lightcards.git/commitdiff
Fix calculation of progress
authorArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 03:53:46 +0000 (22:53 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 03:53:46 +0000 (22:53 -0500)
lightcards/display.py

index 4dab9e1ad47a1e533a79c300c0ce1a674fe88b95..0e58870fb7c907e9a34d1fa033723fe6d25c9f8f 100755 (executable)
@@ -9,7 +9,7 @@ def disp_bar(stdscr, stack, headers, obj):
     if len(stack) <= 1:
         percent = "100"
     else:
-        percent = str(round(obj.getIdx() / (len(stack)) * 100)).zfill(3)
+        percent = str(round(obj.getIdx() / (len(stack) - 1) * 100)).zfill(3)
 
     stdscr.insstr(mlines - 1, 0,
                   "[" +