diff --git a/strichliste.lua b/strichliste.lua index 818cdab..be31ed0 100755 --- a/strichliste.lua +++ b/strichliste.lua @@ -115,9 +115,9 @@ local function form_data() end local function format_duration(t) - if t > 86400 then return string.format("%d days", t / 86400) end - if t > 3600 then return string.format("%d hours", t / 3600) end - if t > 60 then return string.format("%d minutes", t / 60) end + if t > 86400 then return string.format("%d day%s", t / 86400, math.floor(t / 86400) ~= 1 and "s" or "") end + if t > 3600 then return string.format("%d hour%s", t / 3600, math.floor(t / 3600) ~= 1 and "s" or "") end + if t > 60 then return string.format("%d minute%s", t / 60, math.floor(t / 60) ~= 1 and "s" or "") end return string.format("%d seconds", t) end @@ -253,7 +253,7 @@ local function r_user(username) ]]) - print("