From 77d008f792b9bad33fd266cb51bd9ebf36288045 Mon Sep 17 00:00:00 2001 From: Milan Vit Date: Thu, 12 Jul 2018 10:56:12 +0900 Subject: [PATCH] Adjusted calculating the number of battery hearts --- powerline/segments/common/bat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerline/segments/common/bat.py b/powerline/segments/common/bat.py index c892f62a..a84e730c 100644 --- a/powerline/segments/common/bat.py +++ b/powerline/segments/common/bat.py @@ -270,7 +270,7 @@ def battery(pl, format='{ac_state} {capacity:3.0%}', steps=5, gamify=False, full ret = [] if gamify: denom = int(steps) - numer = int(denom * capacity / 100) + numer = int(round(denom * capacity / 100.0, 0)) ret.append({ 'contents': online if ac_powered else offline, 'draw_inner_divider': False,