Content deleted Content added
per request, adding optional |pct_style=notratio per request |
fix inconsistent use of ranking_style=='wpct' or ranking_style=='%w' which was causing strange results when either was uses |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 32:
if ranking_style=='w' or ranking_style=='win' or ranking_style=='wins' or ranking_style=='none' then
-- Based on wins
elseif ranking_style=='wperc' or ranking_style=='win percentage' or ranking_style=='wpct' or ranking_style=='%w' then
show_wperc = true
elseif ranking_style=='perc' or ranking_style=='percentage' or ranking_style=='%' then
Line 91:
fa_letter = 'R'
fa_word_sing = 'Run'
fa_word_plur = 'Runs'
elseif for_against_style=='l' or for_against_style=='leg' or for_against_style=='legs' then
fa_letter = 'L'
fa_word_sing = 'Leg'
fa_word_plur = 'Legs'
elseif for_against_style=='none' then
hide_for_against = true
Line 104 ⟶ 108:
-- Whether to use goal percentage instead
local do_percentage = yesno(Args['use_goal_percentage'] or Args['use_against_percentage'] or Args['use_point_percentage'] or 'no')
local do_point_for_avg = yesno(Args['use_goals_per_match'] or Args['use_points_per_match'] or 'no')
Line 299 ⟶ 303:
--Some sports use draw as well
win_perc = (pct_style == 'ratio') and
mm._precision_format((2*wins + draws + s_pts) / (2*matches), 3) or
mm._precision_format(100*(2*wins + draws + s_pts) / (2*matches),
-- Allow win_perc to be altered due to point deductions/additions
ppg = mm._precision_format(points / matches, 2)
if (losses > 0 or draws > 0) and pct_style == 'ratio' then
-- Drop the leading zero (from the string)
win_perc = string.sub(win_perc,2,string.len(win_perc))
end
end
if ranking_style=='wperc' or ranking_style=='win percentage' or ranking_style=='wpct' or ranking_style=='%w' then
if matches == 0 then
win_perc = '—'
Line 340 ⟶ 345:
else
gcomp = mm._precision_format(100 * gfor / gaig , 1)
end
elseif yesno(Args['use_against_percentage'] or 'no') then
-- Now it is the percentage
if (gfor == '?') or (gaig == '?') or gfor == 0 then
gcomp = '—'
else
gcomp = mm._precision_format(100 * gaig / gfor , 1)
end
elseif yesno(Args['use_point_percentage'] or 'no') then
Line 417 ⟶ 429:
win_fw=ii_fw
win_string = ''
elseif ranking_style=='wperc' or ranking_style=='win percentage' or ranking_style=='wpct' or ranking_style=='%w' then
-- Based on percentage
rank_wperc = true
Line 564 ⟶ 576:
-- ------------------------------------------------------------
local status_code, status_called = {}, {}
status_code = { A='Advance to a further round', C='
E='Eliminated', G='
R='Relegated', T='Qualified, but not yet
local status_letters = (Args['status_order'] or '') .. 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|