<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ASports_table%2FBadminton_team</id>
	<title>Module:Sports table/Badminton team - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ASports_table%2FBadminton_team"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Sports_table/Badminton_team&amp;action=history"/>
	<updated>2026-06-14T15:26:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://mywikibiz.com/index.php?title=Module:Sports_table/Badminton_team&amp;diff=479576&amp;oldid=prev</id>
		<title>Zoran: Pywikibot 6.4.0</title>
		<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Sports_table/Badminton_team&amp;diff=479576&amp;oldid=prev"/>
		<updated>2021-07-16T07:20:00Z</updated>

		<summary type="html">&lt;p&gt;Pywikibot 6.4.0&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Style for football tables&lt;br /&gt;
local pp = {}&lt;br /&gt;
&lt;br /&gt;
function pp.header(t,Args,p_sub,pos_label,group_col,VTE_text,full_table,results_header_txt)&lt;br /&gt;
	-- Load relevant modules&lt;br /&gt;
	local yesno = require('Module:Yesno')&lt;br /&gt;
	&lt;br /&gt;
	-- Create table header&lt;br /&gt;
	-- Pre stuff&lt;br /&gt;
	local team_width = Args['teamwidth'] or '165'&lt;br /&gt;
	local sort_text = ''&lt;br /&gt;
	local sort_table_val = Args['sortable_table'] 	or 'no'&lt;br /&gt;
	if yesno(sort_table_val) then sort_text = 'sortable' end&lt;br /&gt;
	table.insert(t,'{|class=&amp;quot;wikitable '..sort_text..'&amp;quot; style=&amp;quot;text-align:center;&amp;quot;\n')            			-- Open table&lt;br /&gt;
	&lt;br /&gt;
	-- Custom header options&lt;br /&gt;
	local draw_head_text = Args['draw_header'] or '&amp;lt;abbr title=&amp;quot;Drawn&amp;quot;&amp;gt;D&amp;lt;/abbr&amp;gt;'&lt;br /&gt;
	local group_head_text = Args['group_header'] or '&amp;lt;abbr title=&amp;quot;Group&amp;quot;&amp;gt;Grp&amp;lt;/abbr&amp;gt;'&lt;br /&gt;
	local team_head_text = Args['team_header'] or 'Team'&lt;br /&gt;
	local loss_first = Args['loss_before_draw'] or false&lt;br /&gt;
	-- What to rank the teams by&lt;br /&gt;
	local ranking_style = Args['ranking_style'] or 'pts'&lt;br /&gt;
	local show_points, show_perc = false&lt;br /&gt;
	ranking_style = string.lower(ranking_style)&lt;br /&gt;
	if ranking_style=='w' or ranking_style=='win' or ranking_style=='wins' then&lt;br /&gt;
		-- Based on wins&lt;br /&gt;
	elseif ranking_style=='perc' or ranking_style=='percentage' or ranking_style=='%' then&lt;br /&gt;
		-- Based on percentage&lt;br /&gt;
		show_perc = true&lt;br /&gt;
	else&lt;br /&gt;
		-- Based on points&lt;br /&gt;
		show_points = true&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Use points instead of goals for/against&lt;br /&gt;
	local for_against_style = Args['for_against_style'] 	or 'matches'&lt;br /&gt;
	local fa_letter, fa_word_sing, fa_word_plur&lt;br /&gt;
	local hide_for_against = false&lt;br /&gt;
	-- First convert to lower case if it is a string&lt;br /&gt;
	for_against_style = string.lower(for_against_style)&lt;br /&gt;
	if for_against_style=='m' or for_against_style=='match' or for_against_style=='matches' then&lt;br /&gt;
		fa_letter = 'M'&lt;br /&gt;
		fa_word_sing = 'Match'&lt;br /&gt;
		fa_word_plur = 'Matches'&lt;br /&gt;
	elseif for_against_style=='none' then&lt;br /&gt;
		hide_for_against = true&lt;br /&gt;
	else&lt;br /&gt;
		fa_letter = 'M'&lt;br /&gt;
		fa_word_sing = 'Match'&lt;br /&gt;
		fa_word_plur = 'Matches'&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Whether to use goal ratio (goal average) instead&lt;br /&gt;
	local use_ratio_val = Args['use_goal_ratio'] 	or 'no'&lt;br /&gt;
	local do_ratio = false&lt;br /&gt;
	-- True if exist, false otherwise&lt;br /&gt;
	if yesno(use_ratio_val) then do_ratio = true end&lt;br /&gt;
	&lt;br /&gt;
	-- Whether to use goal percentage instead&lt;br /&gt;
	local use_percentage_val = Args['use_goal_percentage'] 	or 'no'&lt;br /&gt;
	local do_percentage = false&lt;br /&gt;
	-- True if exist, false otherwise&lt;br /&gt;
	if yesno(use_percentage_val) then do_percentage = true end&lt;br /&gt;
&lt;br /&gt;
			-- Use points instead of point for/against&lt;br /&gt;
			local game_for_against_style = Args['game_for_against_style'] 	or 'games'&lt;br /&gt;
			local gfa_letter, gfa_word_sing, gfa_word_plur&lt;br /&gt;
			local hide_game_for_against = false&lt;br /&gt;
			-- First convert to lower case if it is a string&lt;br /&gt;
			for_against_style = string.lower(for_against_style)&lt;br /&gt;
			if game_for_against_style=='g' or game_for_against_style=='game' or game_for_against_style=='games' then&lt;br /&gt;
				gfa_letter = 'G'&lt;br /&gt;
				gfa_word_sing = 'Game'&lt;br /&gt;
				gfa_word_plur = 'Games'&lt;br /&gt;
				elseif game_for_against_style=='none' then&lt;br /&gt;
			hide_game_for_against = true&lt;br /&gt;
			else&lt;br /&gt;
				gfa_letter = 'G'&lt;br /&gt;
				gfa_word_sing = 'Game'&lt;br /&gt;
				gfa_word_plur = 'Games'&lt;br /&gt;
			end&lt;br /&gt;
	&lt;br /&gt;
			-- Whether to use goal ratio (goal average) instead&lt;br /&gt;
			local use_ratio_val = Args['use_goal_ratio'] 	or 'no'&lt;br /&gt;
			local do_ratio = false&lt;br /&gt;
			-- True if exist, false otherwise&lt;br /&gt;
			if yesno(use_ratio_val) then do_ratio = true end&lt;br /&gt;
	&lt;br /&gt;
			-- Whether to use goal percentage instead&lt;br /&gt;
			local use_percentage_val = Args['use_goal_percentage'] 	or 'no'&lt;br /&gt;
			local do_percentage = false&lt;br /&gt;
			-- True if exist, false otherwise&lt;br /&gt;
			if yesno(use_percentage_val) then do_percentage = true end&lt;br /&gt;
	&lt;br /&gt;
				-- Use points instead of point for/against&lt;br /&gt;
				local point_for_against_style = Args['point_for_against_style'] 	or 'points'&lt;br /&gt;
				local pfa_letter, pfa_word_sing, pfa_word_plur&lt;br /&gt;
				local hide_point_for_against = false&lt;br /&gt;
				-- First convert to lower case if it is a string&lt;br /&gt;
				for_against_style = string.lower(for_against_style)&lt;br /&gt;
				if point_for_against_style=='p' or point_for_against_style=='match' or point_for_against_style=='points' then&lt;br /&gt;
					pfa_letter = 'P'&lt;br /&gt;
					pfa_word_sing = 'Point'&lt;br /&gt;
					pfa_word_plur = 'Points'&lt;br /&gt;
				elseif point_for_against_style=='none' then&lt;br /&gt;
				hide_point_for_against = true&lt;br /&gt;
				else&lt;br /&gt;
					pfa_letter = 'P'&lt;br /&gt;
					pfa_word_sing = 'Point'&lt;br /&gt;
					pfa_word_plur = 'Points'&lt;br /&gt;
				end&lt;br /&gt;
				-- Whether to use goal ratio (goal average) instead&lt;br /&gt;
				local use_ratio_val = Args['use_goal_ratio'] 	or 'no'&lt;br /&gt;
				local do_ratio = false&lt;br /&gt;
				-- True if exist, false otherwise&lt;br /&gt;
				if yesno(use_ratio_val) then do_ratio = true end&lt;br /&gt;
	&lt;br /&gt;
				-- Whether to use goal percentage instead&lt;br /&gt;
				local use_percentage_val = Args['use_goal_percentage'] 	or 'no'&lt;br /&gt;
				local do_percentage = false&lt;br /&gt;
				-- True if exist, false otherwise&lt;br /&gt;
				if yesno(use_percentage_val) then do_percentage = true end&lt;br /&gt;
	&lt;br /&gt;
	-- Initialize&lt;br /&gt;
	local tt = {}&lt;br /&gt;
	tt.count = 0 		-- Up by one after every call&lt;br /&gt;
	tt.tab_text = t		-- Actual text&lt;br /&gt;
	-- Actual headers&lt;br /&gt;
	tt = p_sub.colhead(tt,20,pos_label)										-- Position col&lt;br /&gt;
	-- Add group header&lt;br /&gt;
	if full_table and group_col then&lt;br /&gt;
		tt = p_sub.colhead(tt,20,group_head_text)			-- Group col&lt;br /&gt;
	end&lt;br /&gt;
	tt = p_sub.colhead(tt,team_width,team_head_text..VTE_text)				-- Team col&lt;br /&gt;
	tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;Played&amp;quot;&amp;gt;Pld&amp;lt;/abbr&amp;gt;')				-- Matches played col&lt;br /&gt;
	if full_table then&lt;br /&gt;
		tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;Won&amp;quot;&amp;gt;W&amp;lt;/abbr&amp;gt;')				-- Win col&lt;br /&gt;
		if loss_first then&lt;br /&gt;
			tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;Lost&amp;quot;&amp;gt;L&amp;lt;/abbr&amp;gt;')			-- Loss col&lt;br /&gt;
		else&lt;br /&gt;
			tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;Lost&amp;quot;&amp;gt;L&amp;lt;/abbr&amp;gt;')			-- Loss col&lt;br /&gt;
		end&lt;br /&gt;
		if not hide_for_against then&lt;br /&gt;
			tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..fa_word_plur..' for&amp;quot;&amp;gt;'..fa_letter..'F&amp;lt;/abbr&amp;gt;')		-- For col&lt;br /&gt;
			tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..fa_word_plur..' against&amp;quot;&amp;gt;'..fa_letter..'A&amp;lt;/abbr&amp;gt;')	-- Against col&lt;br /&gt;
			if do_ratio then&lt;br /&gt;
				tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..fa_word_sing..' ratio&amp;quot;&amp;gt;'..fa_letter..'R&amp;lt;/abbr&amp;gt;')	-- Ratio col&lt;br /&gt;
			elseif do_percentage then&lt;br /&gt;
				tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..fa_word_sing..' percentage&amp;quot;&amp;gt;%&amp;lt;/abbr&amp;gt;')			-- Percentage col&lt;br /&gt;
			else&lt;br /&gt;
				tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..fa_word_sing..' difference&amp;quot;&amp;gt;'..fa_letter..'D&amp;lt;/abbr&amp;gt;')	-- Difference col&lt;br /&gt;
			end&lt;br /&gt;
					if not hide_game_for_against then&lt;br /&gt;
		          	tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..gfa_word_plur..' for&amp;quot;&amp;gt;'..gfa_letter..'F&amp;lt;/abbr&amp;gt;')		-- For col&lt;br /&gt;
		        	tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..gfa_word_plur..' against&amp;quot;&amp;gt;'..gfa_letter..'A&amp;lt;/abbr&amp;gt;')	-- Against col&lt;br /&gt;
			        if do_ratio then&lt;br /&gt;
			        	tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..gfa_word_sing..' ratio&amp;quot;&amp;gt;'..gfa_letter..'R&amp;lt;/abbr&amp;gt;')	-- Ratio col&lt;br /&gt;
			        elseif do_percentage then&lt;br /&gt;
				        tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..gfa_word_sing..' percentage&amp;quot;&amp;gt;%&amp;lt;/abbr&amp;gt;')			-- Percentage col&lt;br /&gt;
			        else&lt;br /&gt;
				        tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..gfa_word_sing..' difference&amp;quot;&amp;gt;'..gfa_letter..'D&amp;lt;/abbr&amp;gt;')	-- Difference col&lt;br /&gt;
			        end&lt;br /&gt;
			        &lt;br /&gt;
						if not hide_point_for_against then&lt;br /&gt;
		          			tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..pfa_word_plur..' for&amp;quot;&amp;gt;'..pfa_letter..'F&amp;lt;/abbr&amp;gt;')		-- For col&lt;br /&gt;
		        			tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..pfa_word_plur..' against&amp;quot;&amp;gt;'..pfa_letter..'A&amp;lt;/abbr&amp;gt;')	-- Against col&lt;br /&gt;
			        	if do_ratio then&lt;br /&gt;
			        		tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..pfa_word_sing..' ratio&amp;quot;&amp;gt;'..pfa_letter..'R&amp;lt;/abbr&amp;gt;')	-- Ratio col&lt;br /&gt;
			    		elseif do_percentage then&lt;br /&gt;
				        	tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..pfa_word_sing..' percentage&amp;quot;&amp;gt;%&amp;lt;/abbr&amp;gt;')			-- Percentage col&lt;br /&gt;
			        	else&lt;br /&gt;
				        	tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;'..pfa_word_sing..' difference&amp;quot;&amp;gt;'..pfa_letter..'D&amp;lt;/abbr&amp;gt;')	-- Difference col&lt;br /&gt;
				        	end&lt;br /&gt;
			        	end&lt;br /&gt;
			        end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if show_points then&lt;br /&gt;
		tt = p_sub.colhead(tt,20,'&amp;lt;abbr title=&amp;quot;Points&amp;quot;&amp;gt;Pts&amp;lt;/abbr&amp;gt;')					-- Points col&lt;br /&gt;
	elseif show_perc then&lt;br /&gt;
		tt = p_sub.colhead(tt,36,'&amp;lt;abbr title=&amp;quot;Win percentage&amp;quot;&amp;gt;PCT&amp;lt;/abbr&amp;gt;')			-- Win percentage col&lt;br /&gt;
	end&lt;br /&gt;
	if full_table then&lt;br /&gt;
		tt.count = tt.count+1&lt;br /&gt;
		table.insert(tt.tab_text,results_header_txt)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return tt&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function pp.row(frame,t,Args,p_sub,notes_exist,hth_id_list,full_table,rand_val,team_list,team_code_ii,ii_start,ii_end,ii_fw,bg_col,N_teams,ii,ii_show)&lt;br /&gt;
	-- Build the inner parts of individual rows&lt;br /&gt;
	&lt;br /&gt;
	-- Sub-module usage&lt;br /&gt;
	local mm = require('Module:Math')&lt;br /&gt;
	local yesno = require('Module:Yesno')&lt;br /&gt;
	&lt;br /&gt;
	-- Get custom/default options for in table&lt;br /&gt;
	local win_points = tonumber(Args['winpoints'])				or 1&lt;br /&gt;
	local loss_points = tonumber(Args['losspoints'])			or 0&lt;br /&gt;
	&lt;br /&gt;
	-- Order of draws and losses --&lt;br /&gt;
	local loss_first = Args['loss_before_draw']                 or false	&lt;br /&gt;
	&lt;br /&gt;
	-- Get some input&lt;br /&gt;
	local wins = tonumber(Args['win_'..team_code_ii])			or 0&lt;br /&gt;
	local losses = tonumber(Args['loss_'..team_code_ii])		or 0&lt;br /&gt;
	local mfor = tonumber(Args['mf_'..team_code_ii]) or	tonumber(Args['mf_'..team_code_ii]) or 0&lt;br /&gt;
	local maig = tonumber(Args['ma_'..team_code_ii]) or	tonumber(Args['ma_'..team_code_ii]) or 0&lt;br /&gt;
	local gfor = tonumber(Args['gf_'..team_code_ii]) or	tonumber(Args['gf_'..team_code_ii]) or 0&lt;br /&gt;
	local gaig = tonumber(Args['ga_'..team_code_ii]) or	tonumber(Args['ga_'..team_code_ii]) or 0&lt;br /&gt;
	local pfor = tonumber(Args['pf_'..team_code_ii]) or	tonumber(Args['pf_'..team_code_ii]) or 0&lt;br /&gt;
	local paig = tonumber(Args['pa_'..team_code_ii]) or	tonumber(Args['pa_'..team_code_ii]) or 0&lt;br /&gt;
	local s_pts = tonumber(Args['adjust_points_'..team_code_ii]) or tonumber(Args['startpoints_'..team_code_ii]) or 0&lt;br /&gt;
	local hth_local = Args['hth_'..team_code_ii]				or nil&lt;br /&gt;
	-- Then calculate some values&lt;br /&gt;
	local matches = wins + losses&lt;br /&gt;
	local points = win_points*wins + loss_points*losses + s_pts&lt;br /&gt;
	&lt;br /&gt;
	local win_perc = ''&lt;br /&gt;
	if matches == 0 then &lt;br /&gt;
		-- Escape for zero matches&lt;br /&gt;
		win_perc = '&amp;amp;mdash;' &lt;br /&gt;
	else&lt;br /&gt;
		--Some sports use draw as well&lt;br /&gt;
		win_perc = mm._precision_format((2*wins) / (2*matches), 3)&lt;br /&gt;
		if losses &amp;gt; 0 then&lt;br /&gt;
			-- Drop the leading zero (from the string)&lt;br /&gt;
			win_perc = string.sub(win_perc,2,string.len(win_perc))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Show for/against&lt;br /&gt;
	local for_against_style = Args['for_against_style'] 	or 'goals'&lt;br /&gt;
	local hide_for_against = false&lt;br /&gt;
	for_against_style = string.lower(for_against_style)&lt;br /&gt;
	if for_against_style=='none' then&lt;br /&gt;
		hide_for_against = true&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Comparison of for against&lt;br /&gt;
	local mcomp&lt;br /&gt;
	-- Whether to use goal ratio (goal average) or goal percentage instead&lt;br /&gt;
	local use_ratio_val = Args['use_goal_ratio'] 	or 'no'&lt;br /&gt;
	local use_percentage_val = Args['use_goal_percentage'] 	or 'no'&lt;br /&gt;
	local skip_sign&lt;br /&gt;
	if yesno(use_ratio_val) then&lt;br /&gt;
		-- Now it is the goal ratio/goal average&lt;br /&gt;
		if maig == 0 then&lt;br /&gt;
			mcomp = '&amp;amp;mdash;'&lt;br /&gt;
		else&lt;br /&gt;
			mcomp = mm._precision_format(gfor / gaig, 3)&lt;br /&gt;
		end&lt;br /&gt;
	elseif yesno(use_percentage_val) then&lt;br /&gt;
		-- Now it is the percentage&lt;br /&gt;
		if maig == 0 then&lt;br /&gt;
			mcomp = '&amp;amp;mdash;'&lt;br /&gt;
		else&lt;br /&gt;
			mcomp = mm._precision_format(100 * gfor / gaig , 1)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- It's match difference&lt;br /&gt;
		mcomp = mfor - maig&lt;br /&gt;
		-- Formatting with signs&lt;br /&gt;
		if mcomp&amp;gt;0 then&lt;br /&gt;
			mcomp='+'..mcomp&lt;br /&gt;
		elseif mcomp &amp;lt; 0 then&lt;br /&gt;
			mcomp='&amp;amp;minus;'..-mcomp&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
		local gcomp&lt;br /&gt;
	-- Whether to use goal ratio (goal average) or goal percentage instead&lt;br /&gt;
	local use_ratio_val = Args['use_goal_ratio'] 	or 'no'&lt;br /&gt;
	local use_percentage_val = Args['use_goal_percentage'] 	or 'no'&lt;br /&gt;
	local skip_sign&lt;br /&gt;
	if yesno(use_ratio_val) then&lt;br /&gt;
		-- Now it is the goal ratio/goal average&lt;br /&gt;
		if gaig == 0 then&lt;br /&gt;
			gcomp = '&amp;amp;mdash;'&lt;br /&gt;
		else&lt;br /&gt;
			gcomp = mm._precision_format(gfor / gaig, 3)&lt;br /&gt;
		end&lt;br /&gt;
	elseif yesno(use_percentage_val) then&lt;br /&gt;
		-- Now it is the percentage&lt;br /&gt;
		if gaig == 0 then&lt;br /&gt;
			gcomp = '&amp;amp;mdash;'&lt;br /&gt;
		else&lt;br /&gt;
			gcomp = mm._precision_format(100 * gfor / gaig , 1)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- It's match difference&lt;br /&gt;
		gcomp = gfor - gaig&lt;br /&gt;
		-- Formatting with signs&lt;br /&gt;
		if gcomp&amp;gt;0 then&lt;br /&gt;
			gcomp='+'..gcomp&lt;br /&gt;
		elseif gcomp &amp;lt; 0 then&lt;br /&gt;
			gcomp='&amp;amp;minus;'..-gcomp&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
		local pcomp&lt;br /&gt;
	-- Whether to use goal ratio (goal average) or goal percentage instead&lt;br /&gt;
	local use_ratio_val = Args['use_goal_ratio'] 	or 'no'&lt;br /&gt;
	local use_percentage_val = Args['use_goal_percentage'] 	or 'no'&lt;br /&gt;
	local skip_sign&lt;br /&gt;
	if yesno(use_ratio_val) then&lt;br /&gt;
		-- Now it is the goal ratio/goal average&lt;br /&gt;
		if paig == 0 then&lt;br /&gt;
			pcomp = '&amp;amp;mdash;'&lt;br /&gt;
		else&lt;br /&gt;
			pcomp = mm._precision_format(gfor / gaig, 3)&lt;br /&gt;
		end&lt;br /&gt;
	elseif yesno(use_percentage_val) then&lt;br /&gt;
		-- Now it is the percentage&lt;br /&gt;
		if paig == 0 then&lt;br /&gt;
			pcomp = '&amp;amp;mdash;'&lt;br /&gt;
		else&lt;br /&gt;
			pcomp = mm._precision_format(100 * gfor / gaig , 1)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- It's match difference&lt;br /&gt;
		pcomp = pfor - paig&lt;br /&gt;
		-- Formatting with signs&lt;br /&gt;
		if pcomp&amp;gt;0 then&lt;br /&gt;
			pcomp='+'..pcomp&lt;br /&gt;
		elseif pcomp &amp;lt; 0 then&lt;br /&gt;
			pcomp='&amp;amp;minus;'..-pcomp&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Some local vars	&lt;br /&gt;
	local hth_string&lt;br /&gt;
	local tt_return = p_sub.hth(frame,Args,full_table,hth_id_list,hth_local,notes_exist,team_list,team_code_ii,ii_start,ii_end,rand_val)&lt;br /&gt;
	hth_string = tt_return.str&lt;br /&gt;
	hth_id_list = tt_return.list&lt;br /&gt;
	notes_exist = tt_return.notes_exist&lt;br /&gt;
	&lt;br /&gt;
	-- What to rank the teams by&lt;br /&gt;
	local ranking_style = Args['ranking_style'] or 'pts'&lt;br /&gt;
	local rank_points, rank_perc = false&lt;br /&gt;
	local win_fw, win_string&lt;br /&gt;
	ranking_style = string.lower(ranking_style)&lt;br /&gt;
	if ranking_style=='w' or ranking_style=='win' or ranking_style=='wins' then&lt;br /&gt;
		-- Based on wins&lt;br /&gt;
		win_fw = 'font-weight: bold;'&lt;br /&gt;
		win_string = hth_string&lt;br /&gt;
	elseif ranking_style=='perc' or ranking_style=='percentage' or ranking_style=='%' then&lt;br /&gt;
		-- Based on percentage&lt;br /&gt;
		rank_perc = true&lt;br /&gt;
		win_fw=ii_fw&lt;br /&gt;
		win_string = ''&lt;br /&gt;
	else&lt;br /&gt;
		-- Based on points&lt;br /&gt;
		rank_points = true&lt;br /&gt;
		win_fw=ii_fw&lt;br /&gt;
		win_string = ''&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Row building&lt;br /&gt;
	table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..matches..'\n') 		-- Played&lt;br /&gt;
	if full_table then&lt;br /&gt;
		table.insert(t,'| style=&amp;quot;'..win_fw..bg_col..'&amp;quot; |'..wins..win_string..'\n') 			-- Won&lt;br /&gt;
		&lt;br /&gt;
		if loss_first then&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..losses..'\n') 	-- Lost&lt;br /&gt;
		else&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..losses..'\n') 	-- Lost&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if not hide_for_against then&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..mfor..'\n') 		-- MF&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..maig..'\n')		-- MA&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..mcomp..'\n')      -- Match comparison&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..gfor..'\n') 		-- GF&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..gaig..'\n')		-- GA&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..gcomp..'\n')      -- Game comparison&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..pfor..'\n') 		-- PF&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..paig..'\n')		-- PA&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;'..ii_fw..bg_col..'&amp;quot; |'..pcomp..'\n')      -- Point comparison&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
	end&lt;br /&gt;
	if rank_points then&lt;br /&gt;
		-- Add &amp;amp;minus; for negative point totals&lt;br /&gt;
		if points&amp;lt;0 then&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;font-weight: bold;'..bg_col..'&amp;quot; | &amp;amp;minus;'..-points..hth_string..'\n')&lt;br /&gt;
		else&lt;br /&gt;
			table.insert(t,'| style=&amp;quot;font-weight: bold;'..bg_col..'&amp;quot; | '..points..hth_string..'\n')&lt;br /&gt;
		end&lt;br /&gt;
	elseif rank_perc then&lt;br /&gt;
		table.insert(t,'| style=&amp;quot;font-weight: bold;'..bg_col..'&amp;quot; | '..win_perc..hth_string..'\n')&lt;br /&gt;
	end&lt;br /&gt;
	return {t=t, notes_exist=notes_exist, hth_id_list=hth_id_list}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function pp.status(Args)&lt;br /&gt;
	-- Declare status options&lt;br /&gt;
	-- ------------------------------------------------------------&lt;br /&gt;
	-- NOTE: If you add to status_code, also add to status_called and status_letters!!&lt;br /&gt;
	-- Or functionality will be compromised&lt;br /&gt;
	-- ------------------------------------------------------------&lt;br /&gt;
	local status_code, status_called = {}&lt;br /&gt;
	status_code = {	A='Advance to a further round', C='Champion', D='Disqualified', &lt;br /&gt;
		E='Eliminated', G='Guest', H='Host', O='Play-off winner', P='Promoted', Q='Qualified to the phase indicated',&lt;br /&gt;
		R='Relegated', T='Qualified, but not yet to the particular phase indicated',&lt;br /&gt;
		X='?', Y='?', Z='?'}&lt;br /&gt;
	status_called = {	A=false, C=false, D=false, E=false, G=false, H=false, O=false, P=false,&lt;br /&gt;
		Q=false, R=false, T=false, X=false, Y=false, Z=false}&lt;br /&gt;
	local status_letters = 'ACDEGHOPQRTXYZ'&lt;br /&gt;
	&lt;br /&gt;
	-- Status position (before or after read and default)&lt;br /&gt;
	local stat_pos_val = Args['status_pos'] or ''&lt;br /&gt;
	local status_position = 'after' 	-- Default location&lt;br /&gt;
	stat_pos_val = string.lower(stat_pos_val)&lt;br /&gt;
	if stat_pos_val=='before' then&lt;br /&gt;
		status_position = 'before'&lt;br /&gt;
	elseif stat_pos_val=='after' then&lt;br /&gt;
		status_position = 'after'&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Read in custom status options&lt;br /&gt;
	if Args['status_text_X'] then status_code.X = Args['status_text_X'] end&lt;br /&gt;
	if Args['status_text_Y'] then status_code.Y = Args['status_text_Y'] end&lt;br /&gt;
	if Args['status_text_Z'] then status_code.Z = Args['status_text_Z'] end&lt;br /&gt;
	&lt;br /&gt;
	return {code=status_code, called=status_called, letters=status_letters, position=status_position}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return pp&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>