יחידה:Election results – הבדלי גרסאות

Add valid, invalid and turnout swing
(totalvotes paramter for when invalid/valid split isn't known (e.g. 2013 Caymanian general election))
(Add valid, invalid and turnout swing)
:wikitext(pct(ovalid[k], ovalid[k] + invalid[k]))
end
if headingsargs['sw'] or headings['seats'] or headings['scinvalidsw'] then
row:tag('td')
:wikitext(args['validsw'])
local cspan = (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0)
if headings['seats'] or headings['sc'] then
local cspan = (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0)
row
:tag('td')
:attr('colspan', cspan > 1 and cspan or nil)
end
elseif headings['sw'] or headings['seats'] or headings['sc'] then
local cspan = (headings['sw'] and 1 or 0) + (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0)
row
:wikitext(pct(invalid[k], ovalid[k] + invalid[k]))
end
if headingsargs['sw'] or headings['seats'] or headings['scinvalidsw'] then
row:tag('td')
:wikitext(args['invalidsw'])
if headings['seats'] or headings['sc'] then
local cspan = (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0)
row
:tag('td')
:attr('colspan', cspan > 1 and cspan or nil)
end
elseif headings['sw'] or headings['seats'] or headings['sc'] then
local cspan = (headings['sw'] and 1 or 0) + (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0)
row
:wikitext(pct(1,1))
end
if headingsargs['sw'] or headings['seats'] or headings['scinvalidsw'] then
row:tag('td')
:wikitext('–')
if headings['seats'] or headings['sc'] then
local cspan = (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0)
row
:tag('td')
:attr('colspan', cspan > 1 and cspan or nil)
end
elseif headings['sw'] or headings['seats'] or headings['sc'] then
local cspan = (headings['sw'] and 1 or 0) + (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0)
row
end
end
if headingsargs['sw'] or headings['seats'] or headings['scturnoutsw'] then
row:tag('td')
:wikitext(args['turnoutsw'])
if headings['seats'] or headings['sc'] then
local cspan = (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0)
row
:tag('td')
:attr('colspan', cspan > 1 and cspan or nil)
end
elseif headings['sw'] or headings['seats'] or headings['sc'] then
local cspan = (headings['sw'] and 1 or 0) + (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0)
row