Rudimentary fix for bug introduced on bat time remaining
This commit is contained in:
parent
78e3d37fb5
commit
9eca19a838
|
@ -71,10 +71,17 @@ local function worker(format, warg)
|
|||
elseif state == "-" then
|
||||
timeleft = tonumber(remaining) / tonumber(rate)
|
||||
else
|
||||
return {state, percent, time}
|
||||
return {state, percent, time}
|
||||
end
|
||||
local hoursleft
|
||||
local minutesleft
|
||||
if timeleft < 0 then
|
||||
hoursleft = 0
|
||||
minutesleft = 0
|
||||
else
|
||||
hoursleft = math.floor(timeleft)
|
||||
minutesleft = math.floor((timeleft - hoursleft) * 60 )
|
||||
end
|
||||
local hoursleft = math.min(math.floor(timeleft), 0)
|
||||
local minutesleft = math.min(math.floor((timeleft - hoursleft) * 60 ), 0)
|
||||
time = string.format("%02d:%02d", hoursleft, minutesleft)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue