<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://igoaddons.eu.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ABaseConvert</id>
	<title>Module:BaseConvert - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://igoaddons.eu.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ABaseConvert"/>
	<link rel="alternate" type="text/html" href="http://igoaddons.eu.org/index.php?title=Module:BaseConvert&amp;action=history"/>
	<updated>2026-04-17T12:00:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0-rc.0</generator>
	<entry>
		<id>http://igoaddons.eu.org/index.php?title=Module:BaseConvert&amp;diff=3604&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://igoaddons.eu.org/index.php?title=Module:BaseConvert&amp;diff=3604&amp;oldid=prev"/>
		<updated>2015-11-01T05:48:43Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 05:48, 1 November 2015&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>Admin</name></author>
		
	</entry>
	<entry>
		<id>http://igoaddons.eu.org/index.php?title=Module:BaseConvert&amp;diff=3603&amp;oldid=prev</id>
		<title>Toohool: Undid revision 572216192 by Technical 13 (talk) this change completely broke {{hexadecimal}}</title>
		<link rel="alternate" type="text/html" href="http://igoaddons.eu.org/index.php?title=Module:BaseConvert&amp;diff=3603&amp;oldid=prev"/>
		<updated>2013-09-09T17:50:52Z</updated>

		<summary type="html">&lt;p&gt;Undid revision 572216192 by &lt;a href=&quot;/index.php?title=Special:Contributions/Technical_13&quot; title=&quot;Special:Contributions/Technical 13&quot;&gt;Technical 13&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:Technical_13&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:Technical 13 (page does not exist)&quot;&gt;talk&lt;/a&gt;) this change completely broke {{hexadecimal}}&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;
local digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'&lt;br /&gt;
&lt;br /&gt;
function normalizeFullWidthChars(s)&lt;br /&gt;
    return mw.ustring.gsub(s, '[！-～]', function(s) &lt;br /&gt;
        return mw.ustring.char(mw.ustring.codepoint(s, 1) - 0xFEE0) &lt;br /&gt;
    end)    &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _convert(n, base, from, precision, width, default, prefix, suffix)&lt;br /&gt;
    n = '' .. n   -- convert to a string&lt;br /&gt;
    &lt;br /&gt;
    -- strip off any leading '0x' (unless x is a valid digit in the input base)&lt;br /&gt;
    from = tonumber(from)&lt;br /&gt;
    if not from or from &amp;lt; 34 then&lt;br /&gt;
        local c&lt;br /&gt;
        n, c = n:gsub('^(-?)0[Xx]', '%1')&lt;br /&gt;
        if c &amp;gt; 0 and not from then from = 16 end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- check for a negative sign. Do this while the input is still in string form,&lt;br /&gt;
    -- because tonumber doesn't support negative numbers in non-10 bases.&lt;br /&gt;
    local sign = ''&lt;br /&gt;
    local c&lt;br /&gt;
    n, c = n:gsub('^-', '')&lt;br /&gt;
    if c &amp;gt; 0 then sign = '-' end&lt;br /&gt;
    &lt;br /&gt;
    -- replace any full-width Unicode characters in the string with their ASCII equivalents&lt;br /&gt;
    n = normalizeFullWidthChars(n)&lt;br /&gt;
    &lt;br /&gt;
    -- handle scientific notation with whitespace around the 'e' e.g. '5 e7'&lt;br /&gt;
    n = n:gsub('%s*[eE]%s*', 'e')&lt;br /&gt;
    &lt;br /&gt;
    from = from or 10&lt;br /&gt;
    local num = tonumber(n, from)&lt;br /&gt;
    base = tonumber(base)&lt;br /&gt;
    precision = tonumber(precision)&lt;br /&gt;
    width = tonumber(width)&lt;br /&gt;
    &lt;br /&gt;
    if not num or not base then return default or n end&lt;br /&gt;
    &lt;br /&gt;
    local i, f = math.modf(num)&lt;br /&gt;
&lt;br /&gt;
    local t = {}&lt;br /&gt;
    repeat&lt;br /&gt;
        local d = (i % base) + 1&lt;br /&gt;
        i = math.floor(i / base)&lt;br /&gt;
        table.insert(t, 1, digits:sub(d, d))&lt;br /&gt;
    until i == 0&lt;br /&gt;
    while #t &amp;lt; (width or 0) do&lt;br /&gt;
        table.insert(t, 1, '0') &lt;br /&gt;
    end&lt;br /&gt;
    local intPart = table.concat(t, '')&lt;br /&gt;
    &lt;br /&gt;
    -- compute the fractional part&lt;br /&gt;
    local tf = {}&lt;br /&gt;
    while f &amp;gt; 0 and #tf &amp;lt; (precision or 10) do&lt;br /&gt;
        f = f * base&lt;br /&gt;
        i, f = math.modf(f)&lt;br /&gt;
        table.insert(tf, digits:sub(i + 1, i + 1))&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- add trailing zeros if needed&lt;br /&gt;
    if precision and #tf &amp;lt; precision then&lt;br /&gt;
        for i = 1, precision - #tf do&lt;br /&gt;
            table.insert(tf, '0') &lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    fracPart = table.concat(tf, '')&lt;br /&gt;
    &lt;br /&gt;
    -- remove trailing zeros if not needed&lt;br /&gt;
    if not precision then&lt;br /&gt;
        fracPart = fracPart:gsub('0*$', '')&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- add the radix point if needed&lt;br /&gt;
    if #fracPart &amp;gt; 0 then&lt;br /&gt;
        fracPart = '.' .. fracPart&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return (prefix or '') .. sign .. intPart .. fracPart .. (suffix or '')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.convert(frame)&lt;br /&gt;
    -- Allow for invocation via #invoke or directly from another module&lt;br /&gt;
    local args&lt;br /&gt;
    if frame == mw.getCurrentFrame() then&lt;br /&gt;
        args = frame.args&lt;br /&gt;
    else&lt;br /&gt;
        args = frame&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local n = args.n&lt;br /&gt;
    local base = args.base&lt;br /&gt;
    local from = args.from&lt;br /&gt;
    local precision = args.precision&lt;br /&gt;
    local width = args.width&lt;br /&gt;
    local default = args.default&lt;br /&gt;
    local prefix = args.prefix&lt;br /&gt;
    local suffix = args.suffix&lt;br /&gt;
    return _convert(n, base, from, precision, width, default, prefix, suffix)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Toohool</name></author>
		
	</entry>
</feed>