Module:Ticks: Difference between revisions

No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
     local seconds = amount * 0.6
     local seconds = amount * 0.6


     -- Format to one decimal place explicitly
     -- Format to one decimal place
     local secondsFormatted = string.format("%.1f", seconds)
     local secondsFormatted = string.format("%.1f", seconds)
    -- Remove trailing .0 if present
    secondsFormatted = secondsFormatted:gsub("%.0$", "")


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


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


return p
return p