Module:Sandbox/Squc/Roman/doc explained

This module converts Roman numerals to decimal form, and rejects invalid ones. It can be used normally, or through another module. This is still under construction, check back in a few days!

This module is intended to run through a template, which is still under construction.

To convert Roman numerals to decimal form, use, which outputs . If the Roman numeral is invalid, it will throw an error. If JavaScript is enabled, you can click the Script error link, and the first sentence should show the cause of the error. The final value will still be given in brackets after the error messages.

To force no errors, use .

To output errors directly into the text, use .

To use this through another module, use something like this:

local roman = require("Module:Sandbox/Squc/Roman")

local romannum = "MMXIII"local value = roman.todecimald(romannum)

Error demonstration! function !! No errors !! Warnings !! Invalid !! Errors
Example MMXIII XXXXX XCC ABC
todecimal
todecimal|mode=1
todecimal|mode=2|disp=Decimal ...
todecimaldIntended for use only from other modules. See below for more details.

Errors will be combined, e.g. "XXXXXXCC" gives:

or with mode=2|disp=0 (default):

todecimaldThe function todecimald (direct) is only intended for use in other modules. The output will be in the form (comma-separated list): Decimal, Error message, Time taken

The decimal will be a number, it will be the converted number if there are no errors or if it is a warning (it is invalid but still can be converted), it will be -1 if there is an error (cannot be converted). The error message is a string and will always exist, it will be "" if no error is found.