<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://scwiki.hu/index.php?action=history&amp;feed=atom&amp;title=Module%3ANumberSpell</id>
	<title>Module:NumberSpell - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://scwiki.hu/index.php?action=history&amp;feed=atom&amp;title=Module%3ANumberSpell"/>
	<link rel="alternate" type="text/html" href="https://scwiki.hu/index.php?title=Module:NumberSpell&amp;action=history"/>
	<updated>2026-05-01T16:56:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://scwiki.hu/index.php?title=Module:NumberSpell&amp;diff=174143&amp;oldid=prev</id>
		<title>Nomad: 1 revision imported: Antares hozzáadva sctoolsról</title>
		<link rel="alternate" type="text/html" href="https://scwiki.hu/index.php?title=Module:NumberSpell&amp;diff=174143&amp;oldid=prev"/>
		<updated>2023-03-01T17:04:05Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported: Antares hozzáadva sctoolsról&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:04, 1 March 2023&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key mediawiki-wiki_:diff::1.12:old-173792:rev-174143 --&gt;
&lt;/table&gt;</summary>
		<author><name>Nomad</name></author>
	</entry>
	<entry>
		<id>https://scwiki.hu/index.php?title=Module:NumberSpell&amp;diff=173792&amp;oldid=prev</id>
		<title>Nomad: Created page with &quot;-- This module converts a number into its written English form. -- For example, &quot;2&quot; becomes &quot;two&quot;, and &quot;79&quot; becomes &quot;seventy-nine&quot;.  local getArgs = require(&#039;Module:Arguments&#039;).getArgs  local p = {}  local max = 100 -- The maximum number that can be parsed.  local ones = { 	[0] = &#039;zero&#039;, 	[1] = &#039;one&#039;, 	[2] = &#039;two&#039;, 	[3] = &#039;three&#039;, 	[4] = &#039;four&#039;, 	[5] = &#039;five&#039;, 	[6] = &#039;six&#039;, 	[7] = &#039;seven&#039;, 	[8] = &#039;eight&#039;, 	[9] = &#039;nine&#039; }  local specials = { 	[10] = &#039;ten&#039;, 	[11] = &#039;eleven...&quot;</title>
		<link rel="alternate" type="text/html" href="https://scwiki.hu/index.php?title=Module:NumberSpell&amp;diff=173792&amp;oldid=prev"/>
		<updated>2023-01-28T06:51:05Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- This module converts a number into its written English form. -- For example, &amp;quot;2&amp;quot; becomes &amp;quot;two&amp;quot;, and &amp;quot;79&amp;quot; becomes &amp;quot;seventy-nine&amp;quot;.  local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs  local p = {}  local max = 100 -- The maximum number that can be parsed.  local ones = { 	[0] = &amp;#039;zero&amp;#039;, 	[1] = &amp;#039;one&amp;#039;, 	[2] = &amp;#039;two&amp;#039;, 	[3] = &amp;#039;three&amp;#039;, 	[4] = &amp;#039;four&amp;#039;, 	[5] = &amp;#039;five&amp;#039;, 	[6] = &amp;#039;six&amp;#039;, 	[7] = &amp;#039;seven&amp;#039;, 	[8] = &amp;#039;eight&amp;#039;, 	[9] = &amp;#039;nine&amp;#039; }  local specials = { 	[10] = &amp;#039;ten&amp;#039;, 	[11] = &amp;#039;eleven...&amp;quot;&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 06:51, 28 January 2023&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>Nomad</name></author>
	</entry>
	<entry>
		<id>https://scwiki.hu/index.php?title=Module:NumberSpell&amp;diff=174142&amp;oldid=prev</id>
		<title>sctools&gt;Alistair3149: Created page with &quot;-- This module converts a number into its written English form. -- For example, &quot;2&quot; becomes &quot;two&quot;, and &quot;79&quot; becomes &quot;seventy-nine&quot;.  local getArgs = require(&#039;Module:Arguments&#039;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://scwiki.hu/index.php?title=Module:NumberSpell&amp;diff=174142&amp;oldid=prev"/>
		<updated>2017-04-26T22:38:57Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- This module converts a number into its written English form. -- For example, &amp;quot;2&amp;quot; becomes &amp;quot;two&amp;quot;, and &amp;quot;79&amp;quot; becomes &amp;quot;seventy-nine&amp;quot;.  local getArgs = require(&amp;#039;Module:Arguments&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module converts a number into its written English form.&lt;br /&gt;
-- For example, &amp;quot;2&amp;quot; becomes &amp;quot;two&amp;quot;, and &amp;quot;79&amp;quot; becomes &amp;quot;seventy-nine&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local max = 100 -- The maximum number that can be parsed.&lt;br /&gt;
&lt;br /&gt;
local ones = {&lt;br /&gt;
	[0] = &amp;#039;zero&amp;#039;,&lt;br /&gt;
	[1] = &amp;#039;one&amp;#039;,&lt;br /&gt;
	[2] = &amp;#039;two&amp;#039;,&lt;br /&gt;
	[3] = &amp;#039;three&amp;#039;,&lt;br /&gt;
	[4] = &amp;#039;four&amp;#039;,&lt;br /&gt;
	[5] = &amp;#039;five&amp;#039;,&lt;br /&gt;
	[6] = &amp;#039;six&amp;#039;,&lt;br /&gt;
	[7] = &amp;#039;seven&amp;#039;,&lt;br /&gt;
	[8] = &amp;#039;eight&amp;#039;,&lt;br /&gt;
	[9] = &amp;#039;nine&amp;#039;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local specials = {&lt;br /&gt;
	[10] = &amp;#039;ten&amp;#039;,&lt;br /&gt;
	[11] = &amp;#039;eleven&amp;#039;,&lt;br /&gt;
	[12] = &amp;#039;twelve&amp;#039;,&lt;br /&gt;
	[13] = &amp;#039;thirteen&amp;#039;,&lt;br /&gt;
	[15] = &amp;#039;fifteen&amp;#039;,&lt;br /&gt;
	[18] = &amp;#039;eighteen&amp;#039;,&lt;br /&gt;
	[20] = &amp;#039;twenty&amp;#039;,&lt;br /&gt;
	[30] = &amp;#039;thirty&amp;#039;,&lt;br /&gt;
	[40] = &amp;#039;forty&amp;#039;,&lt;br /&gt;
	[50] = &amp;#039;fifty&amp;#039;,&lt;br /&gt;
	[60] = &amp;#039;sixty&amp;#039;,&lt;br /&gt;
	[70] = &amp;#039;seventy&amp;#039;,&lt;br /&gt;
	[80] = &amp;#039;eighty&amp;#039;,&lt;br /&gt;
	[90] = &amp;#039;ninety&amp;#039;,&lt;br /&gt;
	[100] = &amp;#039;one hundred&amp;#039;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local formatRules = {&lt;br /&gt;
	{num = 90, rule = &amp;#039;ninety-%s&amp;#039;},&lt;br /&gt;
	{num = 80, rule = &amp;#039;eighty-%s&amp;#039;},&lt;br /&gt;
	{num = 70, rule = &amp;#039;seventy-%s&amp;#039;},&lt;br /&gt;
	{num = 60, rule = &amp;#039;sixty-%s&amp;#039;},&lt;br /&gt;
	{num = 50, rule = &amp;#039;fifty-%s&amp;#039;},&lt;br /&gt;
	{num = 40, rule = &amp;#039;forty-%s&amp;#039;},&lt;br /&gt;
	{num = 30, rule = &amp;#039;thirty-%s&amp;#039;},&lt;br /&gt;
	{num = 20, rule = &amp;#039;twenty-%s&amp;#039;},&lt;br /&gt;
	{num = 10, rule = &amp;#039;%steen&amp;#039;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	local num = tonumber(args[1])&lt;br /&gt;
	local success, result = pcall(p._main, num)&lt;br /&gt;
	if success then&lt;br /&gt;
		return result&lt;br /&gt;
	else&lt;br /&gt;
		return string.format(&amp;#039;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;Error: %s&amp;lt;/strong&amp;gt;&amp;#039;, result) -- &amp;quot;result&amp;quot; is the error message.&lt;br /&gt;
	end&lt;br /&gt;
	return p._main(num)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(num)&lt;br /&gt;
	if type(num) ~= &amp;#039;number&amp;#039; or math.floor(num) ~= num or num &amp;lt; 0 or num &amp;gt; max then&lt;br /&gt;
		error(&amp;#039;input must be an integer between 0 and &amp;#039; .. tostring(max), 2)&lt;br /&gt;
	end&lt;br /&gt;
	-- Check for numbers from 0 to 9.&lt;br /&gt;
	local onesVal = ones[num]&lt;br /&gt;
	if onesVal then&lt;br /&gt;
		return onesVal&lt;br /&gt;
	end&lt;br /&gt;
	-- Check for special numbers.&lt;br /&gt;
	local specialVal = specials[num]&lt;br /&gt;
	if specialVal then&lt;br /&gt;
		return specialVal&lt;br /&gt;
	end&lt;br /&gt;
	-- Construct the number from its format rule.&lt;br /&gt;
	onesVal = ones[num % 10]&lt;br /&gt;
	if not onesVal then&lt;br /&gt;
		error(&amp;#039;Unexpected error parsing input &amp;#039; .. tostring(num))&lt;br /&gt;
	end&lt;br /&gt;
	for i, t in ipairs(formatRules) do&lt;br /&gt;
		if num &amp;gt;= t.num then&lt;br /&gt;
			return string.format(t.rule, onesVal)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	error(&amp;#039;No format rule found for input &amp;#039; .. tostring(num))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>sctools&gt;Alistair3149</name></author>
	</entry>
</feed>