View source for Module:Progression rainbow
MyWikiBiz, Author Your Legacy — Thursday June 05, 2025
Jump to navigationJump to searchYou do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
--[[
This implements {{progression rainbow}}
]]
require('Module:No globals')
local p = {}
-- rounding to first decimal, from http://lua-users.org/wiki/SimpleRound
local function round(num)
return math.floor(num * 10 + 0.5) / 10
end
local function class_percent(param, total)
-- These suck for i18n because the % is forced to the right without spacing,
-- both in a required context (CSS) and unrequired (to-be-displayed text).
-- I.e., there should be a separate version of this or a function parameter
-- which takes a boolean. :(
return tostring(round(100 * param / total)) .. '%'
end
000
1:0
Templates used on this page:
Return to Module:Progression rainbow.