Module:Sports table/Badminton team: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 38:
-- First convert to lower case if it is a string
for_against_style = string.lower(for_against_style)
if for_against_style=='g' or for_against_style=='goalmatch' or for_against_style=='goalsmatches' then
fa_letter = 'GM'
fa_word_sing = 'GoalMatch'
fa_word_plur = 'GoalsMatches'
elseif for_against_style=='p' or for_against_style=='point' or for_against_style=='points' then
fa_letter = 'P'
Line 49:
hide_for_against = true
else
fa_letter = 'GM'
fa_word_sing = 'GoalMatch'
fa_word_plur = 'GoalsMatches'
end
-- Whether to use goal ratio (goal average) instead
Line 119:
-- Get custom/default options for in table
local win_points = tonumber(Args['winpoints']) or 31
local draw_points = tonumber(Args['drawpoints']) or 1
local loss_points = tonumber(Args['losspoints']) or 0
Line 128 ⟶ 127:
-- Get some input
local wins = tonumber(Args['win_'..team_code_ii]) or 0
local draws = tonumber(Args['draw_'..team_code_ii]) or 0
local losses = tonumber(Args['loss_'..team_code_ii]) or 0
local gfor = tonumber(Args['gf_'..team_code_ii]) or tonumber(Args['pf_'..team_code_ii]) or 0
Line 135 ⟶ 133:
local hth_local = Args['hth_'..team_code_ii] or nil
-- Then calculate some values
local matches = wins + draws + losses
local points = win_points*wins + draw_points*draws + loss_points*losses + s_pts