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

Fix error that meant total_sc did not display if none of the inputs were numbers
(Allow electorate and turnout to be entered when they are the only things known)
(Fix error that meant total_sc did not display if none of the inputs were numbers)
local electorate = {tonumber(args.electorate) or 0, tonumber(args.electorate2) or tonumber(args.electorate) or 0}
local turnout = {tonumber(args.turnout) or 0, tonumber(args.turnout2) or 0}
local seats, seatdiff = 0, 0
local row, secondrow
local tracking = ''
if tonumber(args['seats' .. i]) then showtotal.seats = 1 end
seats = seats + (tonumber(args['seats' .. i]) or 0)
end
if args['sc' .. i] then
if tonumber(args['sc' .. i]) then showtotal.sc = 1 end
seatdiff = seatdiff + tonumdash(args['sc' .. i])
end
end
local ovalid = {valid[1], valid[2]}
seats = ((args['total_seats'] or '') == 'TOTAL' and seats) or args['total_seats'] or seats
seatdiffif =seats or (args['total_sc'] or args['valid')] ==or 'TOTAL'((rounds and> seatdiff1) orand args['total_scvalid2']) then
if seats or seatdiff or args['valid'] or ((rounds > 1) and args['valid2']) then
max_rows = max_rows + 1
local i = max_rows
args['sw' .. i] = '–'
args['seats' .. i] = showtotal.seats and seats or nil
args['sc' .. i] = showtotal.sc and seatdiff or nilargs['total_sc']
args['font-weight' .. i] = 'bold'
args['class' .. i] = 'sortbottom'