Extension:RomanNumbers

Add a parser function that converts one arabic number to a roman number or vice versa. If the argument is a string, it try to parse the string and convert it in an arabic number, while, if the argument is an arabic number, the parser converts it in a roman number.

The allowed range is from 1 to 9999 on the conversion arabic to roman, while when converting a roman number to an arabic one the conversion range is limited only by PHP variable's size.

Examples

 * returns CXXIII
 * returns 1,592
 * returns always 1,592 (unrecognized chars are skipped)
 * returns 1,002

Here there is a live example of a page using this parser function.

Installation
To install this extension, add the following to LocalSettings.php: You must create a directory called RomanNumbers in the extensions dir.

RomanNumbers.php
You can create a file called RomanNumbers.php in the RomanNumbers directory. The file must contain the following code: