Module:Convert/doc: Difference between revisions

Content deleted Content added
Module version history: version 30: will probably be in Archive 3 in due course
document call from lua
 
(2 intermediate revisions by one other user not shown)
Line 1:
{{Transwiki guide|text=See [[Template:Convert/Transwiki guide|'''how to copy the convert template''']] for information on copying this module and modifying it for use on another wiki.}}
{{High-risk}}
{{Module rating|p}}
Line 9:
 
The module is called using a template—parameters passed to the template are used by this module to control how a conversion is performed. For example, units can be abbreviated (like <code>kg</code>), or displayed as names (like <code>kilogram</code>), and the output value can be rounded to a specified precision. For usage information, see [[Help:Convert]].
 
The _convert() and _unit() functions can also be called from other Lua modules.
 
== Templates and modules ==
Line 61 ⟶ 63:
 
== Configuration ==
The template that invokes this module can define options to configure the module. For example, to set the [[decimal mark]] to be a comma and the thousands separator to be a dot, use one of the following:
* <code><nowikisource lang='wikitext' inline>{{#invoke:convert|convert|numdot=,|numsep=.}}</nowiki></codesource>
* <source lang='lua' inline>p._convert({numdot=',', numsep='.'}, args)</source>
:Sets the [[decimal mark]] to be a comma, and the thousands separator to be a dot.
 
Other options, with default values, are: