Some laptops such as Acer timeline cause time remaining to be a massive negative number when charging.
This commit is contained in:
parent
4d8c8bfae6
commit
78e3d37fb5
|
@ -73,8 +73,8 @@ local function worker(format, warg)
|
||||||
else
|
else
|
||||||
return {state, percent, time}
|
return {state, percent, time}
|
||||||
end
|
end
|
||||||
local hoursleft = math.floor(timeleft)
|
local hoursleft = math.min(math.floor(timeleft), 0)
|
||||||
local minutesleft = math.floor((timeleft - hoursleft) * 60 )
|
local minutesleft = math.min(math.floor((timeleft - hoursleft) * 60 ), 0)
|
||||||
time = string.format("%02d:%02d", hoursleft, minutesleft)
|
time = string.format("%02d:%02d", hoursleft, minutesleft)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue