[mpd] More math.floor for format progress fix

This commit is contained in:
Lorenzo Gaggini 2019-03-15 14:34:48 +01:00 committed by Nguyễn Gia Phong
parent ea0c5a4b85
commit 60c57e8a41
1 changed files with 4 additions and 4 deletions

View File

@ -34,11 +34,11 @@ function format_progress(elapsed, duration)
elseif dm < 60 then elseif dm < 60 then
return ("%02d:%02d"):format(em, es), ("%02d:%02d"):format(dm, ds) return ("%02d:%02d"):format(em, es), ("%02d:%02d"):format(dm, ds)
elseif dm < 600 then elseif dm < 600 then
return ("%d:%02d:%02d"):format(em / 60, em % 60, es), return ("%d:%02d:%02d"):format(math.floor(em / 60), math.floor(em % 60), es),
("%d:%02d:%02d"):format(dm / 60, dm % 60, ds) ("%d:%02d:%02d"):format(math.floor(dm / 60), math.floor(dm % 60), ds)
else else
return ("%02d:%02d:%02d"):format(em / 60, em % 60, es), return ("%02d:%02d:%02d"):format(math.floor(em / 60), math.floor(em % 60), es),
("%02d:%02d:%02d"):format(dm / 60, dm % 60, ds) ("%02d:%02d:%02d"):format(math.floor(dm / 60), math.floor(dm % 60), ds)
end end
end end
-- }}} -- }}}