<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://ml.sayahna.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AWDL</id>
	<title>Module:WDL - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://ml.sayahna.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AWDL"/>
	<link rel="alternate" type="text/html" href="http://ml.sayahna.org/index.php?title=Module:WDL&amp;action=history"/>
	<updated>2026-04-24T01:54:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.5</generator>
	<entry>
		<id>http://ml.sayahna.org/index.php?title=Module:WDL&amp;diff=12536&amp;oldid=prev</id>
		<title>Cvr: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://ml.sayahna.org/index.php?title=Module:WDL&amp;diff=12536&amp;oldid=prev"/>
		<updated>2014-08-22T07:26:43Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 07:26, 22 August 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Cvr</name></author>
		
	</entry>
	<entry>
		<id>http://ml.sayahna.org/index.php?title=Module:WDL&amp;diff=12535&amp;oldid=prev</id>
		<title>Jackmcbarn: rm unnecessary exports</title>
		<link rel="alternate" type="text/html" href="http://ml.sayahna.org/index.php?title=Module:WDL&amp;diff=12535&amp;oldid=prev"/>
		<updated>2014-05-07T21:37:49Z</updated>

		<summary type="html">&lt;p&gt;rm unnecessary exports&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require('Module:No globals')&lt;br /&gt;
&lt;br /&gt;
local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
local roundAndPad = require('Module:Decimals')._main&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function total(frame, played, won, drawn, lost, category)&lt;br /&gt;
	if played == '-' or played == '—' then&lt;br /&gt;
		return '—'&lt;br /&gt;
	elseif not played then&lt;br /&gt;
		if not won and not drawn and not lost then&lt;br /&gt;
			return ''&lt;br /&gt;
		end&lt;br /&gt;
		return frame:expandTemplate{title = 'Number table sorting', args = { (won or 0) + (drawn or 0) + (lost or 0) }}&lt;br /&gt;
	elseif tonumber(played) ~= (won or 0) + (drawn or 0) + (lost or 0) then&lt;br /&gt;
		return '&amp;lt;span class=&amp;quot;error&amp;quot; style=&amp;quot;font-size:100%&amp;quot;&amp;gt;&amp;lt;abbr title=&amp;quot;GP not equal to W + D + L&amp;quot;&amp;gt;error&amp;lt;/abbr&amp;gt;' .. (category or '') .. '&amp;lt;/span&amp;gt;'&lt;br /&gt;
	else&lt;br /&gt;
		return frame:expandTemplate{title = 'Number table sorting', args = { played }}&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function displayWinPercent(frame, winPercent, decimals)&lt;br /&gt;
	local retval = ''&lt;br /&gt;
	if winPercent &amp;lt; 10 then&lt;br /&gt;
		retval = '&amp;lt;span style=&amp;quot;visibility:hidden;color:transparent;&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
	retval = retval .. frame:expandTemplate{title = 'Number table sorting', args = { roundAndPad(winPercent, decimals or 2) }}&lt;br /&gt;
	if winPercent &amp;gt;= 100 then -- XXX: Should &amp;gt;= be ==? This should never be over 100, but that's what the original template had&lt;br /&gt;
		return retval .. '&amp;lt;span style=&amp;quot;visibility:hidden;color:transparent;&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;'&lt;br /&gt;
	else&lt;br /&gt;
		return retval&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function pct(frame, played, won, drawn, lost, decimals)&lt;br /&gt;
	if played == '-' or played == '—' then&lt;br /&gt;
		return '—'&lt;br /&gt;
	elseif not played then&lt;br /&gt;
		if not won and not drawn and not lost then&lt;br /&gt;
			return ''&lt;br /&gt;
		elseif (won or 0) + (drawn or 0) + (lost or 0) &amp;lt;= 0 then&lt;br /&gt;
			return '&amp;lt;span style=&amp;quot;display:none&amp;quot;&amp;gt;!&amp;lt;/span&amp;gt;—'&lt;br /&gt;
		end&lt;br /&gt;
		return displayWinPercent(frame, 100 * (won or 1) / ((won or 1) + (drawn or 0) + (lost or 0)), decimals) -- XXX: Why is 1 used in the numerator instead of 0 if won isn't set? It's not like that in the case where played is set. It makes sense in the denominator to avoid a divide by zero&lt;br /&gt;
	elseif tonumber(played) &amp;lt;= 0 then&lt;br /&gt;
		return '&amp;lt;span style=&amp;quot;display:none&amp;quot;&amp;gt;!&amp;lt;/span&amp;gt;—'&lt;br /&gt;
	else&lt;br /&gt;
		return displayWinPercent(frame, 100 * (won or 0) / played, decimals)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	local tableprefix = string.format('| style=&amp;quot;%stext-align:%s&amp;quot; |', args.total and 'font-weight:bold;background:#efefef;' or '', args.align or 'center')&lt;br /&gt;
	local retval = tableprefix .. total(frame, args[1], args[2], args[3], args[4], args.demospace and '' or '[[Category:WDL error]]') .. '\n'&lt;br /&gt;
	retval = retval .. tableprefix .. frame:expandTemplate{title = 'Number table sorting', args = { args[2] }} .. '\n'&lt;br /&gt;
	retval = retval .. tableprefix .. frame:expandTemplate{title = 'Number table sorting', args = { args[3] }} .. '\n'&lt;br /&gt;
	retval = retval .. tableprefix .. frame:expandTemplate{title = 'Number table sorting', args = { args[4] }} .. '\n'&lt;br /&gt;
	if args['for'] then&lt;br /&gt;
		retval = retval .. tableprefix .. frame:expandTemplate{title = 'Number table sorting', args = { args['for'] }} .. '\n'&lt;br /&gt;
	end&lt;br /&gt;
	if args.against then&lt;br /&gt;
		retval = retval .. tableprefix .. frame:expandTemplate{title = 'Number table sorting', args = { args.against }} .. '\n'&lt;br /&gt;
	end&lt;br /&gt;
	if args.diff == 'yes' then&lt;br /&gt;
		if tonumber(args['for']) and tonumber(args.against) then&lt;br /&gt;
			retval = retval .. tableprefix .. string.format('%+d\n', args['for'] - args.against)&lt;br /&gt;
		else&lt;br /&gt;
			retval = retval .. tableprefix .. '&amp;lt;span style=&amp;quot;display:none&amp;quot;&amp;gt;!&amp;lt;/span&amp;gt;—\n'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return retval .. tableprefix .. pct(frame, args[1], args[2], args[3], args[4], args.decimals)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Jackmcbarn</name></author>
		
	</entry>
</feed>