Template:Mi2 to Km2/doc: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Drew R. Smith
No edit summary
imported>Drew R. Smith
No edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:


== Usage ==
== Usage ==
'''This template was created exclusively as a subtemplate for {{tl|Infobox Settlement}}.'''


Usage: <nowiki>{{Mi2 to Km2|mi2|km2|switch|round|link|magn}}</nowiki>
Usage: <nowiki>{{Mi2 to Km2|mi2|km2|switch|round|link|magn}}</nowiki>
Line 17: Line 16:
:*'''Produces''':{{Mi2 to Km2|250||switch}}
:*'''Produces''':{{Mi2 to Km2|250||switch}}


Set ''round'' to define the degree of rounding (e.g. '''1''' for one decimal place).
Set ''round'' to define the degree of rounding (e.g. '''1''' for one decimal place). ''Note:For the "link" and "mag" parameters to work, round must have a value.
:'''Example''':<nowiki>{{Mi2 to Km2|250|||3}}</nowiki>
:'''Example''':<nowiki>{{Mi2 to Km2|250|||3}}</nowiki>
:*'''Produces''':{{Mi2 to Km2|250|||3}}
:*'''Produces''':{{Mi2 to Km2|250|||3}}


Setting ''link'' to any non-empty value causes the units to be wikilinked to [[Square mile]] and [[Square kilometre]].
Setting ''link'' to any non-empty value causes the units to be wikilinked to [[Square mile]] and [[Square kilometre]].
:'''Example''':<nowiki>{{Mi2 to Km2|250||||yes}}</nowiki>
:'''Example''':<nowiki>{{Mi2 to Km2|250|||1|1}}</nowiki>
:*'''Produces''':{{Mi2 to Km2|250|||1|1}}
:*'''Produces''':{{Mi2 to Km2|250|||1|1}}


Setting ''mag'' changes the wikilink behind km2 (for example, set it to '''1 foo''' to link to [[1 foo]] [[km²]]).
Setting ''mag'' changes the wikilink behind km2 (for example, set it to '''1 foo''' to link to [[1 foo]] [[km²]]).
:'''Example''':<nowiki>{{Mi2 to Km2|250||||yes|f00}}</nowiki>
:'''Example''':<nowiki>{{Mi2 to Km2|250|||1|1|f00}}</nowiki>
:*'''Produces'''{{Mi2 to Km2|250|||1|1|f00}}
:*'''Produces'''{{Mi2 to Km2|250|||1|1|f00}}
This template is primarily designed for infoboxes.
== See also ==
*{{tl|convert}} (for use in article text)


<includeonly><!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
<includeonly><!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Conversion templates|Mi2km2]]
[[Category:Conversion templates|Mi2km2]]
</includeonly>
</includeonly>

Latest revision as of 00:22, 15 June 2009


Usage

Usage: {{Mi2 to Km2|mi2|km2|switch|round|link|magn}}

Ordinarily produces: km2 km2 (mi2 sq mi)

If one of mi2 and km2 is omitted, it will be calculated by conversion of the other (which must be numerical or an error will be displayed).

Example:{{Mi2 to Km2|250}}
  • Produces:250 sq mi (647.5 km2)


Setting switch to any non-empty value causes the metric value to be displayed first.

Example:{{Mi2 to Km2|250||switch}}
  • Produces:647.5 km2 (250 sq mi)

Set round to define the degree of rounding (e.g. 1 for one decimal place). Note:For the "link" and "mag" parameters to work, round must have a value.

Example:{{Mi2 to Km2|250|||3}}
  • Produces:250 sq mi (647.497 km2)

Setting link to any non-empty value causes the units to be wikilinked to Square mile and Square kilometre.

Example:{{Mi2 to Km2|250|||1|1}}

Setting mag changes the wikilink behind km2 (for example, set it to 1 foo to link to 1 foo km²).

Example:{{Mi2 to Km2|250|||1|1|f00}}