Module:Sports table/Badminton individual: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 184:
--Some sports use draw as well
local win_perc = mm._precision_format((2*wins) / (2*matches), 3)''
if matches == 0 then
-- Escape for zero matches
win_perc = '—'
else
elseif losses > 0 then
win_perc = mm._precision_format((2*wins) / (2*matches), 3)
-- Drop the leading zero (from the string)
elseif if losses > 0 then
win_perc = string.sub(win_perc,2,string.len(win_perc))
-- Drop the leading zero (from the string)
win_perc = string.sub(win_perc,2,string.len(win_perc))
end
end
Line 331 ⟶ 334:
if not hide_for_against then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..mfor..'\n') -- MF
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..maig..'\n') -- MA
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..mcomp..'\n') -- Match comparison
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gfor..'\n') -- GF
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gaig..'\n') -- GA
Line 364:
local status_code, status_called = {}
status_code = { A='Advance to a further round', C='Champion', D='Disqualified',
E='Eliminated', G='Guest', H='Host', N='Did not start', O='Play-off winner',
P='Promoted', Q='Qualified to the phase indicated', R='Relegated',
R='Relegated', T='Qualified, but not yet to the particular phase indicated',
X='?', Y='?', Z='?'}
status_called = { A=false, C=false, D=false, E=false, G=false, H=false, ON=false, PO=false,
P=false, Q=false, R=false, T=false, X=false, Y=false, Z=false}
local status_letters = 'ACDEGHOPQRTXYZACDEGHNOPQRTXYZ'
-- Status position (before or after read and default)