osc: fix cache displaying 60s in some cases

It was caused by string.format rounding e.g. 59.9 to 60.
This commit is contained in:
Funami580 2021-11-26 17:15:50 +01:00 committed by avih
parent cc4ac14d51
commit 448fe0226b
1 changed files with 2 additions and 2 deletions

View File

@ -2095,10 +2095,10 @@ function osc_init()
dmx_cache = state.dmx_cache
end
local min = math.floor(dmx_cache / 60)
local sec = dmx_cache % 60
local sec = math.floor(dmx_cache % 60) -- don't round e.g. 59.9 to 60
return "Cache: " .. (min > 0 and
string.format("%sm%02.0fs", min, sec) or
string.format("%3.0fs", dmx_cache))
string.format("%3.0fs", sec))
end
-- volume