From: Steven Barth Date: Sun, 17 Aug 2008 15:15:33 +0000 (+0000) Subject: #108 X-Git-Tag: 0.8.0~385 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d33e42b53622f606f46e443ff91c34d407cd5605;p=oweals%2Fluci.git #108 --- diff --git a/modules/admin-core/luasrc/tools/webadmin.lua b/modules/admin-core/luasrc/tools/webadmin.lua index 7f123ec4d..1e3d9e002 100644 --- a/modules/admin-core/luasrc/tools/webadmin.lua +++ b/modules/admin-core/luasrc/tools/webadmin.lua @@ -35,7 +35,7 @@ function date_format(secs) local hour = 0 local days = 0 - secs = math.floor(tonumber(secs)) + secs = math.floor(secs) if secs > 60 then mins = math.floor(secs / 60) secs = secs % 60 @@ -52,9 +52,9 @@ function date_format(secs) end if days > 0 then - return string.format("%dd %02dh %02dmin %02ds", days, hour, mins, secs) + return string.format("%.0fd %02.0fh %02.0fmin %02.0fs", days, hour, mins, secs) else - return string.format("%02dh %02dmin %02ds", hour, mins, secs) + return string.format("%02.0fh %02.0fmin %02.0fs", hour, mins, secs) end end