Module:Sports table: Difference between revisions

Content deleted Content added
Try tostring for negative numbers in gdiff
Allow proper minus signs for negative values in table
Line 61:
table.insert(t,'| '..gfor..'\n') -- GF
table.insert(t,'| '..gaig..'\n') -- GA
-- For goal difference insert + or − as needed
table.insert(t,'| '..tostring(gdiff)..'\n') -- GD
table.insert(t,'| style="font-weight: bold;" | '..points..'\n') -- Points
if gdiff>0 then
table.insert(t,'| +'..tostring(gdiff)..'\n') -- GD
elseif gdiff == 0 then
table.insert(t,0)
else
table.insert(t,'−'..-gdiff)
end
table.insert(t,'\n')
-- Add − for negative point totals
table.insert(t,'| style="font-weight: bold;" | ')
if points<0 then
table.insert(t,'&minus;'..-points)
else
table.insert(t,points)
end
table.insert(t,'\n')
end