Module:Election results/sandbox: Difference between revisions

Content deleted Content added
+
+
Line 108:
:wikitext(string.format('\[\[%s\]\]', args['party' .. v]))
end
local cell = mw.html.create('td')
cell
:css('text-align', 'right')
if args['votes' .. v] then
cell
:wikitext(string.formatfmt('\[\[%s\]\]', args['partyvotes' .. v]))
end
row:node(cell)
local cell = mw.html.create('td')
cell
:css('text-align', 'right')
if args['votes' .. v] then
cell
:wikitext(fmtstring.format('%.2f%%', args['votes' .. v] / valid * 100))
end
row:node(cell)
local cell = mw.html.create('td')
cell
:css('text-align', 'right')
if args['votes' .. v] then
cell
:wikitext(string.format('%.2f%%', args['votes' .. v] / valid * 100))
end
row:node(cell)
 
elseif cand then
row
:tag('td')
:wikitext(string.format('\[\[%s\]\]', args['cand' .. v]))
if args['party_name' .. v] then
row
:tag('td')
:wikitext(string.format('\[\[%s\|%s\]\]', args['party' .. v], args['party_name' .. v]))
else
row
:tag('td')
:wikitext(string.format('\[\[%s\]\]', args['party' .. v]))
end
local cell = mw.html.create('td')
cell
:css('text-align', 'right')
if args['votes' .. v] then
cell
:wikitext(fmt(args['votes' .. v]))
end
row:node(cell)
local cell = mw.html.create('td')
cell
:css('text-align', 'right')
if args['votes' .. v] then
cell
:wikitext(string.format('%.2f%%', args['votes' .. v] / valid * 100))
end
row:node(cell)
else
if args['party_name' .. v] then
row
Line 154 ⟶ 179:
end
row:node(cell)
else
if args['party_name' .. v] then
row
:tag('td')
:wikitext(string.format('\[\[%s\|%s\]\]', args['party' .. v], args['party_name' .. v]))
else
row
:tag('td')
:wikitext(string.format('\[\[%s\]\]', args['party' .. v]))
end
local cell = mw.html.create('td')
cell
:css('text-align', 'right')
if args['votesseats' .. v] then
cell
:wikitext(fmt(args['votesseats' .. v]))
end
row:node(cell)
Line 175 ⟶ 190:
cell
:css('text-align', 'right')
if args['votessc' .. v] then
cell
:wikitext(string.formatfmt('%.2f%%', args['votessc' .. v] / valid * 100))
end
row:node(cell)