From 0e37d220b793edbefb7064315cb7274fe5282862 Mon Sep 17 00:00:00 2001 From: Luke Bonham Date: Wed, 24 Aug 2016 17:14:06 +0200 Subject: [PATCH] #162 comment 241640965: fix magnitude check when 100% on AC --- widgets/bat.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/bat.lua b/widgets/bat.lua index 9ab0cdc..d84a5d8 100644 --- a/widgets/bat.lua +++ b/widgets/bat.lua @@ -125,7 +125,7 @@ local function worker(args) rate_time = sum_energy_now / div end - if rate_time < 0.01 then -- check for magnitude discrepancies (#199) + if 0 < rate_time and rate_time < 0.01 then -- check for magnitude discrepancies (#199) rate_time_magnitude = math.abs(math.floor(math.log10(rate_time))) rate_time = rate_time * 10^(rate_time_magnitude - 2) end