<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AAddcommas</id>
	<title>Module:Addcommas - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AAddcommas"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Addcommas&amp;action=history"/>
	<updated>2026-04-30T06:37:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.runerealm.org/index.php?title=Module:Addcommas&amp;diff=394&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;--fuse2=Removes all commas from arg }} -- -- &lt;nowiki&gt; -- -- Implements {{Addcommas}} --  local p = {}  -- -- main function -- keep public so it can be used in other modules -- function p._add( arg )     local lang = mw.language.getContentLanguage()     local z = tostring( arg )     local y = mw.text.split( z, &#039;[%-–]&#039; )     l...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Addcommas&amp;diff=394&amp;oldid=prev"/>
		<updated>2024-10-11T21:36:04Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;--[[ {{Helper module|name=Addcommas |fname1=_add(arg) |ftype1=Number |fuse1=Formats the number arg with commas |fname2=_strip(arg) |ftype2=Number |fuse2=Removes all commas from arg }} --]] -- &amp;lt;nowiki&amp;gt; -- -- Implements {{Addcommas}} --  local p = {}  -- -- main function -- keep public so it can be used in other modules -- function p._add( arg )     local lang = mw.language.getContentLanguage()     local z = tostring( arg )     local y = mw.text.split( z, &amp;#039;[%-–]&amp;#039; )     l...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
{{Helper module|name=Addcommas&lt;br /&gt;
|fname1=_add(arg)&lt;br /&gt;
|ftype1=Number&lt;br /&gt;
|fuse1=Formats the number arg with commas&lt;br /&gt;
|fname2=_strip(arg)&lt;br /&gt;
|ftype2=Number&lt;br /&gt;
|fuse2=Removes all commas from arg&lt;br /&gt;
}}&lt;br /&gt;
--]]&lt;br /&gt;
-- &amp;lt;nowiki&amp;gt;&lt;br /&gt;
--&lt;br /&gt;
-- Implements {{Addcommas}}&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- main function&lt;br /&gt;
-- keep public so it can be used in other modules&lt;br /&gt;
--&lt;br /&gt;
function p._add( arg )&lt;br /&gt;
    local lang = mw.language.getContentLanguage()&lt;br /&gt;
    local z = tostring( arg )&lt;br /&gt;
    local y = mw.text.split( z, &amp;#039;[%-–]&amp;#039; )&lt;br /&gt;
    local x&lt;br /&gt;
&lt;br /&gt;
    -- strip any existing commas&lt;br /&gt;
    z = z:gsub( &amp;#039;,&amp;#039;, &amp;#039;&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
    -- handle ranges as separate numbers&lt;br /&gt;
    -- required by [[Module:Exchange]] (p._table)&lt;br /&gt;
    if y[1] ~= &amp;#039;&amp;#039; and y[2] then&lt;br /&gt;
        y[1] = tonumber( y[1] )&lt;br /&gt;
        y[2] = tonumber( y[2] )&lt;br /&gt;
        x = lang:formatNum( y[1] ) .. &amp;#039;–&amp;#039; .. lang:formatNum( y[2] )&lt;br /&gt;
    else&lt;br /&gt;
        x = lang:formatNum( tonumber( z ) )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return x&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- strips any existing commas in the input&lt;br /&gt;
--&lt;br /&gt;
function p._strip( str )&lt;br /&gt;
    str = tostring( str )&lt;br /&gt;
    return str:gsub( &amp;#039;,&amp;#039;, &amp;#039;&amp;#039; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.commas ( frame )&lt;br /&gt;
    local str = frame:getParent().args[1]&lt;br /&gt;
    return p._add( str )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>