<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AInflation</id>
	<title>Module:Inflation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AInflation"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Inflation&amp;action=history"/>
	<updated>2026-05-28T17:54:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Inflation&amp;diff=136896&amp;oldid=prev</id>
		<title>imported&gt;Ahecht: allow for excess whitespace and newlines</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Inflation&amp;diff=136896&amp;oldid=prev"/>
		<updated>2022-07-19T19:10:45Z</updated>

		<summary type="html">&lt;p&gt;allow for excess whitespace and newlines&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p={}&lt;br /&gt;
&lt;br /&gt;
function p._parse(index, template, frame)&lt;br /&gt;
	if not frame then frame = mw.getCurrentFrame() end&lt;br /&gt;
	local error = &amp;#039; when using {{tl|Inflation/&amp;#039; .. template .. &amp;#039;}}.{{main other|[[Category:Pages with errors in inflation template]]}}&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
	if index then&lt;br /&gt;
		local tempTitle = &amp;quot;Inflation/&amp;quot; .. index .. &amp;quot;/dataset&amp;quot;&lt;br /&gt;
		local dataset = mw.title.new(tempTitle, &amp;quot;Template&amp;quot;)&lt;br /&gt;
		if dataset.exists then&lt;br /&gt;
			local datatable = {}&lt;br /&gt;
			local data = mw.text.gsplit(mw.ustring.gsub(dataset:getContent(), &amp;quot;\n?%s*|%s*#default%s*&amp;quot;, &amp;quot;&amp;quot;), &amp;quot;\n&amp;quot;)&lt;br /&gt;
			for row in data do&lt;br /&gt;
				local year, value = mw.ustring.match(row, &amp;quot;%s*\|%s*(%d%d%d%d)%s*=%s*([%d%.]+)&amp;quot;)&lt;br /&gt;
				if year and value then&lt;br /&gt;
					datatable[tonumber(year)] = tonumber(value)&lt;br /&gt;
				else&lt;br /&gt;
					year, value = mw.ustring.match(row, &amp;quot;%s*\|%s*(%d%d%d%d)%s*=%s*{{(#expr:.*)}}&amp;quot;)&lt;br /&gt;
					if year and value then&lt;br /&gt;
						datatable[tonumber(year)] = tonumber(frame:callParserFunction( value ))&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if table.maxn(datatable) then&lt;br /&gt;
				return datatable&lt;br /&gt;
			else&lt;br /&gt;
				error = &amp;#039;&amp;lt;span class=&amp;quot;error&amp;quot;&amp;gt;Error: unable to parse &amp;quot;Template:&amp;#039; .. tempTitle .. &amp;#039;&amp;quot;&amp;#039; .. error&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			error = &amp;#039;&amp;lt;span class=&amp;quot;error&amp;quot;&amp;gt;Error: undefined index &amp;quot;&amp;#039; .. index .. &amp;#039;&amp;quot;&amp;#039; .. error&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		error = &amp;#039;&amp;lt;span class=&amp;quot;error&amp;quot;&amp;gt;Error: no index specified&amp;#039; .. error&lt;br /&gt;
	end&lt;br /&gt;
	return frame:preprocess(error)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.year(frame)&lt;br /&gt;
	local index = frame.args.index or frame.args[1] or frame:getParent().args.index or frame:getParent().args[1]&lt;br /&gt;
	local result = p._parse(index, &amp;#039;year&amp;#039;, frame)&lt;br /&gt;
	if type(result) == &amp;quot;table&amp;quot; then&lt;br /&gt;
		return table.maxn(result)&lt;br /&gt;
	else&lt;br /&gt;
		return result&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Ahecht</name></author>
	</entry>
</feed>