Module:Convert/doc explained

This module converts a value from one unit of measurement to another. For example:

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 kg), or displayed as names (like kilogram), and the output value can be rounded to a specified precision. For usage information, see .

Templates and modules

Templates that invoke this module are:

The following modules are required:

The following modules are optional and are used only if required and if the module exists:

For Wikidata support the following modules are required:

The following help pages are available:

A page containing a convert error is added to the following hidden category, providing the page is in a specified namespace (articles, by default):

Units are defined in the wikitext of the master list of units.

is transcluded into every page using the convert module, so experimenting with a new unit in that module would involve a significant overhead. The module is an alternative which is only transcluded on pages with a unit that is not defined in the main data module.

lists all unit links so they can be checked.

Sandbox

When making a change, copy the current modules to the sandbox pages, then edit the sandbox copies:

Use the following template to test the results (example <nowiki>{{convert/sandbox|123|lb|kg}}</nowiki>):

invokes with parameter which causes convert to use the sandbox modules rather than the normal modules.

The following should be used to test the results of editing the convert modules.

It is not necessary to save a testcases page before viewing test results. For example, could be edited to change the tests. While still editing that page, paste (without quotes) into the page title box under "Preview page with this template", then click "Show preview".

Configuration

The template that invokes this module can define options to configure the module. For example:

Sets the decimal mark to be a comma, and the thousands separator to be a dot.

Other options, with default values, are:

An option in the template can specify that the sandbox versions of the modules be used. If specified, the text on the right-hand side of the equals sign must be the name of the subpage for each sandbox module.

All text used for input parameters and for output messages and categories can be customized. For example, at enwiki the option |lk=on can be used to link each displayed unit to its article. The "lk" and "on" can be replaced with any desired text. In addition, input and output numbers can be formatted and can use digits in the local language. See the translation guide for more information.

To do

Document the modules to access Wikidata!

Module version history