Module:Progression rainbow: Difference between revisions

Content deleted Content added
how broken does this break
okay, add text, see how this breaks
Line 15:
end
 
local function width_classesclass_percent(param, divisor)
-- implementation of rounding to first decimal in
-- http://lua-users.org/wiki/SimpleRound
Line 69:
for i, class in pairs(classes) do
if class[1] ~= 0 then
local percentage = class_percent(class[1], divisor)
root:newline()
:tag('td')
:css('background', main_frame:expandTemplate{
title = 'class/colour', args = { class[2] }})
:css('width', width_classes(class[1], divisor)percentage)
:wikitext(percentage .. " " .. class[2] .. "-class")
:done()
end
end
root:newline()
if width_remaining(sum_classes, divisor) then
local remaining = percent_remaining(sum_classes, divisor)
if remaining then
root:tag('td')
:addClass('remaining')
:css('width', width_remaining(sum_classes, divisor)remaining)
:wikitext(remaining .. " remaining")
:done()
:newline()