Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Roman/doc: Difference between revisions

From Neodyland Wiki
Now used by {{Roman}} and {{Roman year}}
Expand documenation
Line 2: Line 2:
*{{tl|Roman}}
*{{tl|Roman}}
*{{tl|Roman year}}
*{{tl|Roman year}}
== Using this module from templates ==
=== Year ===
This function returns a year formatted as a Roman numeral.  It works for years between  1 and 4999999.  The output string may contain HTML tags.  If the input does not look like it contains a year or the year is outside of the supported range an error message is returned.  If an error message is returned, the error message will contain code to categorize pages into [[:Category:Errors reported by Module Roman]].
Usage:
: <code><nowiki>{{#invoke:</nowiki>Roman|Year|''year''}}</code>
=== Numeral ===
This function converts an Arabic numeral into a Roman numeral.  It works for values between 0 and 4999999.  The output string may contain HTML tags.  Arabic numeral zero is output as an empty string.  If the input does not look like it contains a number or the number is outside of the supported range an error message is returned.  If an error message is returned, the error message will contain code to categorize pages into [[:Category:Errors reported by Module Roman]].
Usage:
: <code><nowiki>{{#invoke:</nowiki>Roman|Numeral|''value''}}</code>
== Using this module from Lua code ==
In order to use the functions in this module from another Lua module you first have to import this module.
Example:
: <code>local roman = require('Module:Roman')</code>
=== _Year ===
This function returns a year formatted as a Roman numeral.  It works for years between  1 and 4999999.  The output string may contain HTML tags.  If the input does not look like it contains a year or the year is outside of the supported range an error message is returned.  If an error message is returned, the error message will contain code to categorize pages into [[:Category:Errors reported by Module Roman]].
Usage:
: <code>roman_year = roman._Year(year)</code>
=== _Numeral ===
This function converts an Arabic numeral into a Roman numeral.  It works for values between 0 and 4999999.  The output string may contain HTML tags.  Arabic numeral zero is output as an empty string.  If the input does not look like it contains a number or the number is outside of the supported range an error message is returned.  If an error message is returned, the error message will contain code to categorize pages into [[:Category:Errors reported by Module Roman]].
Usage:
: <code>roman_year = roman._Numeral(value)</code>

Revision as of 22:09, 28 December 2014

This module contains functions for working with Roman numerals. Currently used by:

Using this module from templates

Year

This function returns a year formatted as a Roman numeral. It works for years between 1 and 4999999. The output string may contain HTML tags. If the input does not look like it contains a year or the year is outside of the supported range an error message is returned. If an error message is returned, the error message will contain code to categorize pages into Category:Errors reported by Module Roman.

Usage:

{{#invoke:Roman|Year|year}}

Numeral

This function converts an Arabic numeral into a Roman numeral. It works for values between 0 and 4999999. The output string may contain HTML tags. Arabic numeral zero is output as an empty string. If the input does not look like it contains a number or the number is outside of the supported range an error message is returned. If an error message is returned, the error message will contain code to categorize pages into Category:Errors reported by Module Roman.

Usage:

{{#invoke:Roman|Numeral|value}}

Using this module from Lua code

In order to use the functions in this module from another Lua module you first have to import this module.

Example:

local roman = require('Module:Roman')

_Year

This function returns a year formatted as a Roman numeral. It works for years between 1 and 4999999. The output string may contain HTML tags. If the input does not look like it contains a year or the year is outside of the supported range an error message is returned. If an error message is returned, the error message will contain code to categorize pages into Category:Errors reported by Module Roman.

Usage:

roman_year = roman._Year(year)

_Numeral

This function converts an Arabic numeral into a Roman numeral. It works for values between 0 and 4999999. The output string may contain HTML tags. Arabic numeral zero is output as an empty string. If the input does not look like it contains a number or the number is outside of the supported range an error message is returned. If an error message is returned, the error message will contain code to categorize pages into Category:Errors reported by Module Roman.

Usage:

roman_year = roman._Numeral(value)
Contents
Cookies help us deliver our services. By using our services, you agree to our use of cookies.