Module:Sports table/WDL: Difference between revisions

Content deleted Content added
add optional show_hth
optional |use_goal_diff=no per request
Line 80:
-- Whether to use goal percentage instead
local do_percentage = yesno(Args['use_goal_percentage'] or Args['use_point_percentage'] or 'no')
-- Whether to suppress the GR/GA/G% column entirely
local do_difference = yesno(Args['use_goal_diff'] or 'yes')
 
-- Use games behind header
Line 132 ⟶ 135:
elseif do_percentage then
tt = p_sub.colhead(tt,28,'<abbr title="'..fa_word_sing..' percentage">%</abbr>') -- Percentage col
elseif do_difference then
else
tt = p_sub.colhead(tt,28,'<abbr title="'..fa_word_sing..' difference">'..fa_letter..'D</abbr>') -- Difference col
end
Line 213 ⟶ 216:
 
-- Comparison of for against
local gcomp = nil
-- Whether to use goal ratio (goal average) or goal percentage instead
local skip_sign
Line 237 ⟶ 240:
gcomp = mm._precision_format(100 * gfor / (gfor + gaig) , 2)
end
elseif yesno(Args['use_goal_diff'] or 'yes') then
else
-- It's goal difference
if (gfor == '?') or (gaig == '?') then
Line 359 ⟶ 362:
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gfor..'\n') -- GF
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gaig..'\n') -- GA
if gcomp then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gcomp..'\n') -- Goal comparison
elseend
end