From 60c57e8a413930a30553d5d4ed06c198b100bb27 Mon Sep 17 00:00:00 2001 From: Lorenzo Gaggini Date: Fri, 15 Mar 2019 14:34:48 +0100 Subject: [PATCH] [mpd] More math.floor for format progress fix --- widgets/mpd_all.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/widgets/mpd_all.lua b/widgets/mpd_all.lua index ce9aa96..c419dbc 100644 --- a/widgets/mpd_all.lua +++ b/widgets/mpd_all.lua @@ -34,11 +34,11 @@ function format_progress(elapsed, duration) elseif dm < 60 then return ("%02d:%02d"):format(em, es), ("%02d:%02d"):format(dm, ds) elseif dm < 600 then - return ("%d:%02d:%02d"):format(em / 60, em % 60, es), - ("%d:%02d:%02d"):format(dm / 60, dm % 60, ds) + return ("%d:%02d:%02d"):format(math.floor(em / 60), math.floor(em % 60), es), + ("%d:%02d:%02d"):format(math.floor(dm / 60), math.floor(dm % 60), ds) else - return ("%02d:%02d:%02d"):format(em / 60, em % 60, es), - ("%02d:%02d:%02d"):format(dm / 60, dm % 60, ds) + return ("%02d:%02d:%02d"):format(math.floor(em / 60), math.floor(em % 60), es), + ("%02d:%02d:%02d"):format(math.floor(dm / 60), math.floor(dm % 60), ds) end end -- }}}