<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.cern.ch/index.php?action=history&amp;feed=atom&amp;title=Module%3AConvert%2Fdoc</id>
	<title>Module:Convert/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cern.ch/index.php?action=history&amp;feed=atom&amp;title=Module%3AConvert%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.cern.ch/index.php?title=Module:Convert/doc&amp;action=history"/>
	<updated>2026-04-05T22:16:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.cern.ch/index.php?title=Module:Convert/doc&amp;diff=4903&amp;oldid=prev</id>
		<title>Bbergia: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.cern.ch/index.php?title=Module:Convert/doc&amp;diff=4903&amp;oldid=prev"/>
		<updated>2025-12-01T10:29:34Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:29, 1 December 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Bbergia</name></author>
	</entry>
	<entry>
		<id>https://wiki.cern.ch/index.php?title=Module:Convert/doc&amp;diff=4902&amp;oldid=prev</id>
		<title>wikipedia&gt;Johnuniq: version 31: will probably be in Archive 3</title>
		<link rel="alternate" type="text/html" href="https://wiki.cern.ch/index.php?title=Module:Convert/doc&amp;diff=4902&amp;oldid=prev"/>
		<updated>2025-10-06T07:50:04Z</updated>

		<summary type="html">&lt;p&gt;version 31: will probably be in Archive 3&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Transwiki guide|Template:Convert/Transwiki guide}}&lt;br /&gt;
{{High-risk}}&lt;br /&gt;
{{Module rating|p}}&lt;br /&gt;
{{cascade-protected template|page=module}}&lt;br /&gt;
{{Lua|Module:Convert/data|Module:Convert/text|Module:Convert/wikidata|Module:Convert/wikidata/data|Module:Convert/extra|Module:ConvertNumeric|noprotcat=yes}}&lt;br /&gt;
{{Uses TemplateStyles|Template:Fraction/styles.css|Template:Sfrac/styles.css|noprotcat=yes}}&lt;br /&gt;
This module converts a value from one unit of measurement to another. For example:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{convert|123|lb|kg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → 123 pounds (56 kg)&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;kg&amp;lt;/code&amp;gt;), or displayed as names (like &amp;lt;code&amp;gt;kilogram&amp;lt;/code&amp;gt;), and the output value can be rounded to a specified precision. For usage information, see [[Help:Convert]].&lt;br /&gt;
&lt;br /&gt;
The _convert() and _unit() functions can also be called from other Lua modules.&lt;br /&gt;
&lt;br /&gt;
== Templates and modules ==&lt;br /&gt;
Templates that invoke this module are:&lt;br /&gt;
* {{t|convert}}&lt;br /&gt;
* {{t|cvt}} {{green|1=(convert with abbr=on)}}&lt;br /&gt;
&lt;br /&gt;
The following modules are required:&lt;br /&gt;
* [[Module:Convert]] – &amp;#039;&amp;#039;(this module)&amp;#039;&amp;#039; code to convert units&lt;br /&gt;
* [[Module:Convert/data]] – unit definitions&lt;br /&gt;
* [[Module:Convert/text]] – text messages, and parameter names and values&lt;br /&gt;
&lt;br /&gt;
The following modules are optional and are used only if required and if the module exists:&lt;br /&gt;
* [[Module:Convert/extra]] – extra (temporary) unit definitions; used if a unit is not found in [[Module:Convert/data]]&lt;br /&gt;
* [[Module:ConvertNumeric]] – code to spell an input value in words (only English is supported; however, see [[:vi:Module:ConvertNumeric]])&lt;br /&gt;
&lt;br /&gt;
For Wikidata support the following modules are required:&lt;br /&gt;
* [[Module:Convert/wikidata]]&lt;br /&gt;
* [[Module:Convert/wikidata/data]]&lt;br /&gt;
&lt;br /&gt;
The following help pages are available:&lt;br /&gt;
* [[Help:Convert]] – overview&lt;br /&gt;
* [[Help:Convert messages]] – describes error and warning messages; messages link to this page so it is required when the module is copied to another wiki&lt;br /&gt;
* [[Help:Convert units]] – overview of units&lt;br /&gt;
&lt;br /&gt;
A page containing a convert error is added to the following hidden category, providing the page is in a specified [[WP:Namespace|namespace]] (articles, by default):&lt;br /&gt;
* {{clc|Convert errors}}&lt;br /&gt;
&lt;br /&gt;
Units are defined in the wikitext of the master list of units.&lt;br /&gt;
* [[Module:Convert/documentation/conversion data]] – master list of unit definitions&lt;br /&gt;
* [[Module:Convert/makeunits]] – translates wikitext from the master list to Lua&lt;br /&gt;
* [[Module talk:Convert/makeunits]] – makeunits results; copy the text to [[Module:Convert/data]]&lt;br /&gt;
&lt;br /&gt;
[[Module:Convert/data]] 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:Convert/extra]] module is an alternative which is only transcluded on pages with a unit that is not defined in the main data module.&lt;br /&gt;
&lt;br /&gt;
[[Module talk:Convert/show]] lists all unit links so they can be checked.&lt;br /&gt;
&lt;br /&gt;
== Sandbox ==&lt;br /&gt;
When making a change, copy the current modules to the sandbox pages, then edit the sandbox copies:&lt;br /&gt;
{{#invoke:convert/tester|compare}}&lt;br /&gt;
&lt;br /&gt;
Use the following template to test the results (example &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{convert/sandbox|123|lb|kg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;):&lt;br /&gt;
* [[Template:Convert/sandbox]]&lt;br /&gt;
&lt;br /&gt;
[[Template:Convert/sandbox]] invokes [[Module:Convert/sandbox]] with parameter {{para|sandbox|sandbox}} which causes convert to use the sandbox modules rather than the normal modules.&lt;br /&gt;
&lt;br /&gt;
The following should be used to test the results of editing the convert modules.&lt;br /&gt;
* [[Template:Convert/testcases#Sandbox testcases]] – links to testcases&lt;br /&gt;
* [[Module:Convert/tester]] – module to run tests by comparing template output with fixed text&lt;br /&gt;
&lt;br /&gt;
It is not necessary to save a testcases page before viewing test results. For example, [[Template:Convert/testcases/sandbox4]] could be edited to change the tests. While still editing that page, paste {{nowrap|&amp;quot;&amp;lt;code&amp;gt;Template talk:Convert/testcases/sandbox4&amp;lt;/code&amp;gt;&amp;quot;}} (without quotes) into the page title box under &amp;quot;Preview page with this template&amp;quot;, then click &amp;quot;Show preview&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
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:&lt;br /&gt;
* &amp;lt;source lang=&amp;#039;wikitext&amp;#039; inline&amp;gt;{{#invoke:convert|convert|numdot=,|numsep=.}}&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;lt;source lang=&amp;#039;lua&amp;#039; inline&amp;gt;p._convert({numdot=&amp;#039;,&amp;#039;, numsep=&amp;#039;.&amp;#039;}, args)&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other options, with default values, are:&lt;br /&gt;
* &amp;lt;code&amp;gt;|maxsigfig=14&amp;lt;/code&amp;gt; – maximum number of significant figures&lt;br /&gt;
* &amp;lt;code&amp;gt;|nscat=0&amp;lt;/code&amp;gt; – [[WP:Namespace|namespaces]] (comma separated) in which an error or warning adds a category to the page&lt;br /&gt;
* &amp;lt;code&amp;gt;|warnings=0&amp;lt;/code&amp;gt; – 0 (zero) disables warnings; 1 shows important warnings; 2 shows all warnings&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
* &amp;lt;code&amp;gt;|sandbox=sandbox&amp;lt;/code&amp;gt; – omit for normal operation&lt;br /&gt;
&lt;br /&gt;
All text used for input parameters and for output messages and categories can be customized. For example, at enwiki the option &amp;lt;code&amp;gt;|lk=on&amp;lt;/code&amp;gt; can be used to link each displayed unit to its article. The &amp;quot;&amp;lt;code&amp;gt;lk&amp;lt;/code&amp;gt;&amp;quot; and &amp;quot;&amp;lt;code&amp;gt;on&amp;lt;/code&amp;gt;&amp;quot; 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 [[Template:Convert/Transwiki guide/translate|translation guide]] for more information.&lt;br /&gt;
&lt;br /&gt;
== To do ==&lt;br /&gt;
Document the modules to access Wikidata!&lt;br /&gt;
&lt;br /&gt;
== Module version history ==&lt;br /&gt;
* [[Template talk:Convert/Archive December 2013#Request to switch to Module:Convert|Version 1]] December 2013&lt;br /&gt;
* [[Template talk:Convert/Archive January 2014#Module v2 soon|Version 2]] January 2014&lt;br /&gt;
* [[Template talk:Convert/Archive April 2014#Module version 3|Version 3]] April 2014&lt;br /&gt;
* [[Template talk:Convert/Archive July 2014#Module version 4|Version 4]] July 2014&lt;br /&gt;
* [[Template talk:Convert/Archive September 2014#Module version 5|Version 5]] September 2014&lt;br /&gt;
* [[Template talk:Convert/Archive November 2014#Module version 6|Version 6]] November 2014&lt;br /&gt;
* [[Template talk:Convert/Archive December 2014#Module version 7|Version 7]] December 2014&lt;br /&gt;
* [[Template talk:Convert/Archive February 2015#Module version 8|Version 8]] February 2015&lt;br /&gt;
* [[Template talk:Convert/Archive February 2015#Module version 9|Version 9]] February 2015&lt;br /&gt;
* [[Template talk:Convert/Archive May 2015#Module version 10|Version 10]] May 2015&lt;br /&gt;
* [[Template talk:Convert/Archive June 2015#Module version 11|Version 11]] June 2015&lt;br /&gt;
* [[Template talk:Convert/Archive August 2015#Module version 12|Version 12]] August 2015&lt;br /&gt;
* [[Template talk:Convert/Archive March 2016#Module version 13|Version 13]] March 2016&lt;br /&gt;
* [[Template talk:Convert/Archive June 2016#Module version 14|Version 14]] June 2016 {{green|(introduced handling of Wikidata)}}&lt;br /&gt;
* [[Template talk:Convert/Archive September 2016#Module version 15|Version 15]] September 2016&lt;br /&gt;
* [[Template talk:Convert/Archive January 2017#Module version 16|Version 16]] January 2017&lt;br /&gt;
* [[Template talk:Convert/Archive May 2017#Module version 17|Version 17]] May 2017&lt;br /&gt;
* [[Template talk:Convert/Archive July 2017#Module version 18|Version 18]] July 2017&lt;br /&gt;
* [[Template talk:Convert/Archive August 2017#Module version 19|Version 19]] August 2017 {{green|1=(chain/link units; iferror class; input=x: x can be feet/inches; optional tracking category}}&lt;br /&gt;
* [[Template talk:Convert/Archive December 2017#Module version 20|Version 20]] December 2017 {{green|(changed symbols for dot and micro)}}&lt;br /&gt;
* [[Template talk:Convert/Archive January 2018#Module version 21|Version 21]] January 2018 {{green|(remove many deprecated options)}}&lt;br /&gt;
* [[Template talk:Convert/Archive February 2018#Module version 22|Version 22]] February 2018 {{green|(many unit link changes)}}&lt;br /&gt;
* [[Template talk:Convert/Archive June 2018#Module version 23|Version 23]] June 2018 {{green|1=(warnings for ignored numbered parameters; adj=pre/disp=preunit changes; currency units removed)}}&lt;br /&gt;
* [[Template talk:Convert/Archive May 2019#Module version 24|Version 24]] May 2019 {{green|1=(hidden sort key uses data-sort-value; avoid using the extra data module)}}&lt;br /&gt;
* [[Template talk:Convert/Archive 2#Module version 25|Version 25]] May 2021 {{green|1=(use templatestyles [[Template:Fraction/styles.css]] or [[Template:Sfrac/styles.css]] for fractions)}}&lt;br /&gt;
* [[Template talk:Convert/Archive 2#Module version 26|Version 26]] June 2021 {{green|1=(many unit link changes)}}&lt;br /&gt;
* [[Template talk:Convert/Archive 2#Module version 27|Version 27]] February 2022 {{green|1=(enhance Mach parameters; use spaced en dash when needed; unit tweaks)}}&lt;br /&gt;
* [[Template talk:Convert/Archive 3#Module version 28|Version 28]] April 2023 {{green|1=(new SI prefixes; add disp=semicolon; unit adjustments including fixing scales of mpge and BTU/lb)}}&lt;br /&gt;
* [[Template talk:Convert/Archive 3#Module version 29|Version 29]] May 2023 {{green|1=(liter/litre fix to show symbol &amp;#039;L&amp;#039; rather than &amp;#039;l&amp;#039; per MOS)}}&lt;br /&gt;
* [[Template talk:Convert/Archive 3#Module version 30|Version 30]] October 2024 {{green|1=(units can use convertPlural in languages with more than one plural form and can have a pername; E3km displays &amp;quot;thousand&amp;quot; even with abbr=on)}}&lt;br /&gt;
* [[Template talk:Convert/Archive 3#Module version 31|Version 31]] October 2025 {{green|1=(option error=&amp;#039;&amp;#039;x&amp;#039;&amp;#039; displays &amp;#039;&amp;#039;x&amp;#039;&amp;#039; if an error occurs; a fraction slash may be used in the input value for a variable name)}}&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
[[Category:Modules that add a tracking category]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Module documentation pages]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Johnuniq</name></author>
	</entry>
</feed>