From f2aa096f833015fea1e85f099e4d212a41fc242c Mon Sep 17 00:00:00 2001 From: mutlusun Date: Thu, 23 Feb 2017 22:36:22 +0100 Subject: [PATCH] small fix in bat_freebsd --- widgets/bat_freebsd.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widgets/bat_freebsd.lua b/widgets/bat_freebsd.lua index c87dbfa..919ed6b 100644 --- a/widgets/bat_freebsd.lua +++ b/widgets/bat_freebsd.lua @@ -48,9 +48,9 @@ local function worker(format, warg) -- calculate wear level from (last full / design) capacity local wear = "N/A" if bat_info["Last full capacity"] and bat_info["Design capacity"] then - local l_full = tonumber(string.match(bat_info["Last full capacity"], "[%d]+")) + local l_full = tonumber(string.match(bat_info["Last full capacity"], "[%d]+")) local design = tonumber(string.match(bat_info["Design capacity"], "[%d]+")) - wear = math.floor(100 - (l_full / design * 100)) + wear = math.floor(l_full / design * 100) end -- dis-/charging rate as presented by battery