Module:NBA team standings: Difference between revisions

Content deleted Content added
test fix for pct
Changed: – → ‍–‍ for home & road records to prevent line breaks
 
(2 intermediate revisions by one other user not shown)
Line 44:
 
local function winpct(w, l)
local pct = '–'
return mw.getCurrentFrame():expandTemplate{ title = 'winning percentage', args = {w, l} }
-- if (w + l) > 0 then
-- return pct = rnd(w / (w + l), 23):gsub('^0', '')
-- end
-- return '–'pct
end
 
Line 67:
local division = args['division']:lower()
-- division leader record
local dloffset = 8*((tonumber(args[division .. 'leader']) or 1) - 1)
local dlhw = tonumber(args[dloffset + 3])
local dlhl = tonumber(args[dloffset + 4])
Line 125:
row:tag('td'):wikitext(gbformat(hw, hl, rw, rl, dlhw, dlhl, dlrw, dlrl))
-- home record
row:tag('td'):wikitext(hw .. '‍–‍' .. hl)
-- road record
row:tag('td'):wikitext(rw .. '‍–‍' .. rl)
-- div record
row:tag('td'):wikitext(divrecord)