模块:Convert/doc
这是Module:Convert的文档页面
此模块文档被引用于约109,000个页面。 为了避免造成大规模的影响,所有对此模块文档的编辑应先于沙盒或测试样例上测试。 测试后无误的版本可以一次性地加入此模块文档中,但是修改前请务必于讨论页发起讨论。 模板引用数量会自动更新。 |
本模块将一种单位制下的数值转换到另一种单位制下。举例:
{{convert|123|lb|kg}}
→ 123 pounds (56 kg)
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 Help:Convert.
模板和模块
[编辑]使用本模块的模板:
- Template:Convert
- Template:Cvt (convert with abbr=on)
The following modules are required:
- Module:Convert – (本模块) 单位转换的代码
- Module:Convert/data – 单位定义
- Module:Convert/text – 文本信息、参数名和值
The following modules are optional and are used only if required and if the module exists:
- Module:Convert/extra – extra (temporary) unit definitions; used if a unit is not found in Module:Convert/data
- Module:ConvertNumeric – code to spell an input value in words (only English is supported; however, see vi:Module:ConvertNumeric)
For Wikidata support the following modules are required:
The following help pages are available:
- Help:Convert – overview
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.
- Module:Convert/makeunits – translates wikitext from the master list to Lua
- Module talk:Convert/makeunits – makeunits results; copy the text to Module:Convert/data
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.