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
Revision as of 15:37, 19 May 2025 by Ryan (talk | contribs)
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 = string.format("%.1f", seconds)  -- Keep one decimal place

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

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

return p