Still landing on the old Fandom wiki? Install the HighSpell Wiki Redirector browser extension to automatically redirect all highspell.fandom.com links to highspell.wiki. Works on both Firefox and Chrome, and is open-source. → Learn more and install it now!

Module:Ticks

From HighSpell Wiki
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

    -- Format to one decimal place explicitly
    local secondsFormatted = string.format("%.1f", seconds)

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

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

return p