Difference between revisions of "Template:Infobox dim"
Jump to navigation
Jump to search
imported>The Earwig m (Protected "Template:Infobox dim": Highly visible template: nearly 15,000 mainspace transclusions ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))) |
imported>Zackmann08 (Adding unknown parameter tracking through Category:Pages using infobox dim with unknown parameters using Module:check for unknown parameters) |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
| − | <includeonly>{{Infobox dim/core|{{#if:{{{length_mi|}}}|{{#expr:{{{length_mi}}}*1.609}}|{{{length_km|}}} }}|<!-- | + | <includeonly>{{Infobox dim/core|{{#if:{{{length_mi|}}}|{{#expr:{{formatnum:{{{length_mi}}}|R}}*1.609}}|{{formatnum:{{{length_km|}}}|R}} }}|<!-- |
| − | -->{{#if:{{{width_mi|}}}|{{#expr:{{{width_mi}}}*1.609}}|{{{width_km|}}} }}|<!-- | + | -->{{#if:{{{width_mi|}}}|{{#expr:{{formatnum:{{{width_mi}}}|R}}*1.609}}|{{formatnum:{{{width_km|}}}|R}} }}|<!-- |
| − | -->{{#if:{{{area_mi2|}}}|{{#expr:{{{area_mi2}}}*2. | + | -->{{#switch: 1 |
| + | | {{#if:{{{area_mi2|}}}|1|0}} = {{#expr:{{formatnum:{{{area_mi2}}}|R}}*2.59}} | ||
| + | | {{#if:{{{area_acre|}}}|1|0}} = {{#expr:{{formatnum:{{{area_acre}}}|R}}*0.004047}} | ||
| + | | {{#if:{{{area_ha|}}}|1|0}} = {{#expr:{{formatnum:{{{area_ha}}}|R}}*0.01}} | ||
| + | | {{#if:{{{area_km2|}}}|1|0}} = {{formatnum:{{{area_km2}}}|R}} }} }}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox dim with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox dim]] with unknown parameter "_VALUE_"|ignoreblank=y| area_acre | area_ha | area_km2 | area_mi2 | length_km | length_mi | width_km | width_mi }}<noinclude> | ||
| + | {{Documentation}}</noinclude> | ||
Latest revision as of 21:29, 18 March 2019
| This template uses Lua: |
Usage
{{Infobox dim}} is used inside infoboxes to determine the size of an object. This is passed to geohack to make appropriate map sizes. Parameters are all optional:
- length_mi
- length_km
- width_mi
- width_km
- area_mi2
- area_km2
- area_acre
- area_ha
Source
{{Infobox dim/core|{{#if:{{{length_mi|}}}|{{#expr:{{{length_mi}}}*1.609}}|{{{length_km|}}} }}
|{{#if:{{{width_mi|}}}|{{#expr:{{{width_mi}}}*1.609}}|{{{width_km|}}} }}
|{{#switch: 1
| {{#if:{{{area_mi2|}}}|1|0}} = {{#expr:{{{area_mi2}}}*2.59}}
| {{#if:{{{area_acre|}}}|1|0}} = {{#expr:{{{area_acre}}}*0.004047}}
| {{#if:{{{area_ha|}}}|1|0}} = {{#expr:{{{area_ha}}}*0.01}}
| {{#if:{{{area_km2|}}}|1|0}} = {{{area_km2}}} }} }}
See also
| The above documentation is transcluded from Template:Infobox dim/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |