Module:Ticks

From HighSpell Wiki
Revision as of 22:33, 17 May 2025 by Ryan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Ticks/doc

local p = {}

function p.display(frame)
    local args = frame:getParent().args
    local amount = tonumber(args[1] or args["amount"]) or 0
    local seconds = amount * 0.6
    local roundedSeconds = math.floor(seconds + 0.5)

    local timeDisplay = string.format('<abbr title="Time in seconds">%ds</abbr>', roundedSeconds)

    return string.format("%d [[Ticks]] (%s)", amount, timeDisplay)
end

return p