<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thegoonshow.co.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASpellnum_per_MOS</id>
	<title>Module:Spellnum per MOS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.thegoonshow.co.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASpellnum_per_MOS"/>
	<link rel="alternate" type="text/html" href="https://www.thegoonshow.co.uk/wiki/index.php?title=Module:Spellnum_per_MOS&amp;action=history"/>
	<updated>2026-05-13T21:31:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://www.thegoonshow.co.uk/wiki/index.php?title=Module:Spellnum_per_MOS&amp;diff=15395&amp;oldid=prev</id>
		<title>Kurt: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.thegoonshow.co.uk/wiki/index.php?title=Module:Spellnum_per_MOS&amp;diff=15395&amp;oldid=prev"/>
		<updated>2022-08-25T19:02:16Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:02, 25 August 2022&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>Kurt</name></author>
	</entry>
	<entry>
		<id>https://www.thegoonshow.co.uk/wiki/index.php?title=Module:Spellnum_per_MOS&amp;diff=15394&amp;oldid=prev</id>
		<title>en&gt;MusikBot II: Protected &quot;Module:Spellnum per MOS&quot;: High-risk template or module: 418 transclusions (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://www.thegoonshow.co.uk/wiki/index.php?title=Module:Spellnum_per_MOS&amp;diff=15394&amp;oldid=prev"/>
		<updated>2021-09-28T03:53:56Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/wiki/index.php?title=Module:Spellnum_per_MOS&quot; title=&quot;Module:Spellnum per MOS&quot;&gt;Module:Spellnum per MOS&lt;/a&gt;&amp;quot;: &lt;a href=&quot;https://en.wikipedia.org/wiki/High-risk_templates&quot; class=&quot;extiw&quot; title=&quot;wikipedia:High-risk templates&quot;&gt;High-risk template or module&lt;/a&gt;: 418 transclusions (&lt;a href=&quot;/wiki/index.php?title=User:MusikBot_II/TemplateProtector&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:MusikBot II/TemplateProtector (page does not exist)&quot;&gt;more info&lt;/a&gt;) ([Edit=Require autoconfirmed or confirmed access] (indefinite))&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;
local words = {&amp;quot;thousand&amp;quot;, &amp;quot;million&amp;quot;, &amp;quot;billion&amp;quot;, &amp;quot;trillion&amp;quot;} -- We don't need to go higher than this, no-one knows what an octillion is.&lt;br /&gt;
&lt;br /&gt;
-- For use by other scripts. Takes arguments:&lt;br /&gt;
-- - 1: string or number, value to convert&lt;br /&gt;
-- - forcenum: string for Template:Yesno, forces a result in digits for all n ≥ 10.&lt;br /&gt;
-- - formating options for spellnum: zero, adj, ord, us&lt;br /&gt;
function p.spellnum(args)&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	local numeral = tonumber(args[1])&lt;br /&gt;
	&lt;br /&gt;
   local pass_zero = &amp;quot;zero&amp;quot;&lt;br /&gt;
    if args['zero'] ~= nil and args['zero'] ~= '' then&lt;br /&gt;
    	pass_zero = args['zero']&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
	-- Always return numerals for negative numbers, non-integers, and if (forcenum and numeral &amp;gt;= 10).&lt;br /&gt;
	if numeral &amp;lt; 0 or&lt;br /&gt;
			math.fmod(numeral, 1) ~= 0 or&lt;br /&gt;
			(numeral &amp;gt;= 10 and frame:expandTemplate{ title = 'yesno', args = {args['forcenum']} } == 'yes') then&lt;br /&gt;
		return mw.language.getContentLanguage():formatNum(numeral)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Convert numeral to words&lt;br /&gt;
	local spelled = frame:expandTemplate{ title = 'spellnum', args = {&lt;br /&gt;
		numeral, zero = pass_zero, adj = args['adj'], ord = args['ord'], us = args['us']}}&lt;br /&gt;
	&lt;br /&gt;
	-- Return numerals if more than two words would be needed, else return words&lt;br /&gt;
	if mw.ustring.find(spelled,'%a+[ %-]%a+[ %-]%a+') then&lt;br /&gt;
		-- Handle numbers larger than one million&lt;br /&gt;
		if numeral &amp;gt;= 1000000 and numeral &amp;lt;= 1000000000000000 then&lt;br /&gt;
			local size = math.min(4, math.floor(math.log10(numeral) / 3))&lt;br /&gt;
			numeral = numeral / 1000^size&lt;br /&gt;
			return ({&amp;quot;%.1f &amp;quot;, &amp;quot;%d &amp;quot;, &amp;quot;%d &amp;quot;})[1 + math.floor(math.log10(numeral))]:format(numeral) .. words[size]&lt;br /&gt;
		end&lt;br /&gt;
		return mw.language.getContentLanguage():formatNum(numeral)&lt;br /&gt;
	else &lt;br /&gt;
		return spelled&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	return p.spellnum(frame.args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>en&gt;MusikBot II</name></author>
	</entry>
</feed>