Module:Sports table/Badminton individual: Difference between revisions

Content deleted Content added
No edit summary
Fix division by zero
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