模組:Convert/doc
这是Module:Convert的文档页面
此模块文档被引用於約110,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.