<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.agency/index.php?action=history&amp;feed=atom&amp;title=Module%3ADecimals</id>
		<title>Module:Decimals - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.agency/index.php?action=history&amp;feed=atom&amp;title=Module%3ADecimals"/>
		<link rel="alternate" type="text/html" href="https://wiki.agency/index.php?title=Module:Decimals&amp;action=history"/>
		<updated>2026-07-15T17:50:45Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.1</generator>

	<entry>
		<id>https://wiki.agency/index.php?title=Module:Decimals&amp;diff=462&amp;oldid=prev</id>
		<title>Admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.agency/index.php?title=Module:Decimals&amp;diff=462&amp;oldid=prev"/>
				<updated>2018-10-24T22:40:43Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 22:40, 24 October 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&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>Admin</name></author>	</entry>

	<entry>
		<id>https://wiki.agency/index.php?title=Module:Decimals&amp;diff=461&amp;oldid=prev</id>
		<title>Johnuniq: implement error=text parameter to return text if an error occurs; see Template talk:2018–19 NBA Northwest standings</title>
		<link rel="alternate" type="text/html" href="https://wiki.agency/index.php?title=Module:Decimals&amp;diff=461&amp;oldid=prev"/>
				<updated>2018-06-03T10:28:03Z</updated>
		
		<summary type="html">&lt;p&gt;implement error=text parameter to return text if an error occurs; see &lt;a href=&quot;/index.php?title=Template_talk:2018%E2%80%9319_NBA_Northwest_standings&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Template talk:2018–19 NBA Northwest standings (page does not exist)&quot;&gt;Template talk:2018–19 NBA Northwest standings&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;Module:No globals&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._main(n, d)&lt;br /&gt;
	local num = tonumber(n)&lt;br /&gt;
	if not num then&lt;br /&gt;
		error(&amp;#039;Unable to convert &amp;quot;&amp;#039; .. tostring(n) .. &amp;#039;&amp;quot; to a number&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local decimals = tonumber(d)&lt;br /&gt;
	if not decimals then&lt;br /&gt;
		error(&amp;#039;Unable to convert &amp;quot;&amp;#039; .. tostring(d) .. &amp;#039;&amp;quot; to a number&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local maxDecimals = 14 - math.floor(math.log10(num)) -- to allow a maximum of 15 significant figures, which is the highest guaranteed correct with doubles&lt;br /&gt;
	if decimals &amp;gt; maxDecimals then decimals = maxDecimals end&lt;br /&gt;
	local mult = 10^decimals&lt;br /&gt;
	num = math.floor(num * mult + 0.5) / mult&lt;br /&gt;
	if decimals &amp;lt; 0 then&lt;br /&gt;
		return tostring(num)&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;#039;%.&amp;#039; .. decimals .. &amp;#039;f&amp;#039;, num)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args, pargs = frame.args, frame:getParent().args&lt;br /&gt;
	local function work()&lt;br /&gt;
		return p._main(&lt;br /&gt;
			mw.ext.ParserFunctions.expr(args[1] or pargs[1]),&lt;br /&gt;
			mw.ext.ParserFunctions.expr(args[2] or pargs[2])&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	local success, result = pcall(work)&lt;br /&gt;
	if success then&lt;br /&gt;
		return result&lt;br /&gt;
	end&lt;br /&gt;
	local errtext = args.error or pargs.error&lt;br /&gt;
	if errtext then&lt;br /&gt;
		return errtext&lt;br /&gt;
	end&lt;br /&gt;
	error(result, 0)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Johnuniq</name></author>	</entry>

	</feed>