<?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%3ASandbox%2FMatroc%2FConvertRomanDate</id>
	<title>Module:Sandbox/Matroc/ConvertRomanDate - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FMatroc%2FConvertRomanDate"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Matroc/ConvertRomanDate&amp;action=history"/>
	<updated>2026-07-29T13:10: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:Sandbox/Matroc/ConvertRomanDate&amp;diff=145791&amp;oldid=prev</id>
		<title>imported&gt;Matroc at 07:59, 26 June 2013</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Matroc/ConvertRomanDate&amp;diff=145791&amp;oldid=prev"/>
		<updated>2013-06-26T07:59:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- The Main purpose is to convert ROMAN dates to Arabic numerals&lt;br /&gt;
-- wjk - Matroc &lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.romantonum( frame )&lt;br /&gt;
    local RN = { [&amp;quot;M&amp;quot;] = 1000, [&amp;quot;D&amp;quot;] = 500, [&amp;quot;C&amp;quot;] = 100, [&amp;quot;L&amp;quot;] = 50, [&amp;quot;X&amp;quot;] = 10, [&amp;quot;V&amp;quot;] = 5, [&amp;quot;I&amp;quot;] = 1 }&lt;br /&gt;
    local convert = 0&lt;br /&gt;
    local x, y = 0&lt;br /&gt;
    local input = frame.args[1] or &amp;quot;error&amp;quot;&lt;br /&gt;
    if input == &amp;quot;&amp;quot; then&lt;br /&gt;
       error(&amp;quot;Bad Input Argument! No Data!&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    input = input:upper()&lt;br /&gt;
    input = input:match&amp;#039;^%s*(.*%S)&amp;#039; -- trim spaces at both ends&lt;br /&gt;
    local err = (string.gsub(input,&amp;quot;[MDCLXVI]&amp;quot;,&amp;quot;&amp;quot;))&lt;br /&gt;
    if err:len() ~= 0 then&lt;br /&gt;
       error(&amp;quot;Bad Input Argument! only MDCLXVI as characters allowed&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
 &lt;br /&gt;
    local i = 1&lt;br /&gt;
    local strlen = string.len(input)&lt;br /&gt;
&lt;br /&gt;
    while i &amp;lt; strlen do&lt;br /&gt;
        x, y = RN[ string.sub(input,i,i) ], RN[ string.sub(input,i+1,i+1) ]&lt;br /&gt;
        if x &amp;lt; y then&lt;br /&gt;
            convert = convert + ( y - x )&lt;br /&gt;
            i = i + 2&lt;br /&gt;
        else&lt;br /&gt;
            convert = convert + x&lt;br /&gt;
            i = i + 1    &lt;br /&gt;
        end        &lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if i &amp;lt;= strlen then convert = convert + RN[ string.sub(input,i,i) ] end&lt;br /&gt;
     return convert    &lt;br /&gt;
end&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Matroc</name></author>
	</entry>
</feed>