Template:Mi2 to Km2/doc: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Drew R. Smith
(New page: <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> ;Usage: :<nowiki>{{Mi2 to Km2 | 1 | abbr | spell | precision | wiki}}</nowiki> ;Examples :<nowiki>{{Mi2 to Km2|10000}}</nowiki> &...)
 
imported>Drew R. Smith
No edit summary
Line 1: Line 1:
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
;Usage:
:<nowiki>{{Mi2 to Km2 | 1 | abbr | spell | precision | wiki}}</nowiki>


;Examples
== Usage ==
:<nowiki>{{Mi2 to Km2|10000}}</nowiki>&nbsp;&rarr; {{Mi2 to Km2|10000}}
'''This template was created exclusively as a subtemplate for {{tl|Infobox Settlement}}.'''
:''Abbreviated notation'': <nowiki>{{Mi2 to Km2|10000|abbr=yes}}</nowiki>&nbsp;&rarr; {{Mi2 to Km2|10000|abbr=yes}}
:''Fully spelled out notation'': <nowiki>{{Mi2 to Km2|10000|abbr=no}}</nowiki>&nbsp;&rarr; {{Mi2 to Km2|10000|abbr=no}}


''Italicized'' parameters are optional:
Usage: <nowiki>{{Mi2 to Km2|mi2|km2|switch|round|link|magn}}</nowiki>
*Either '''num''' or '''1''' (an unnamed parameter) is required.  This specifies the number of square miles to be converted to square kilometers.  Please do not format this parameter; i.e., use 1234 instead of 1,234.
*'''''2''''' (a second unnamed parameter) is optional.  This specifies the number of square miles to be converted for the end of a range.  Please do not format this parameter; i.e., use 1234 instead of 1,234.
*'''''abbr''''' can take values of either ''yes'' or ''no''. 
:{|
|-
|
*''yes&nbsp;
|both unit names will be abbreviated i.e. ''sq&nbsp;ft'' and ''m²''
|-
|
*''no
|both unit names will be spelt out i.e. ''square miles'' and ''square kilometers'' or ''square kilometres''
|}
:The default is to spell only the first unit name out as specified in the [[WP:MOSNUM#Units of measurement|Manual of Style for dates and numbers]] i.e. ''square miles'' and ''m²''.
*'''''spell''''' can take values of ''Commonwealth'', ''Com'', ''C'', ''BrE'' or ''UK''.  For any of these values the spelling ''square kilometre(s)'' will be used.  The default spelling is ''square kilometer(s)''.  This is only meaningful when ''abbr'' is set to ''no''.
*'''''precision''''' is the number of decimal digits in the converted value.  Defaulting to conversions to the most precise of the following.
:*conversions rounded down one decimal place as compared to the input value
:**note: Where a range is given the most precise of the inputs is used.
:**note: One square foot is of comparable size to ten square kilometers.
:or
:*conversions rounded to two significant figures
*'''''sigfig''''' specifies the number of significant figures in the converted value.
**This overrides '''''precision'''''.
**Where the conversion is of a range it is the number of significant figures in the first value which is specified with the second being rounded to the same level of precision.
*'''''max precision''''' specifies the maximum precision to round to.
*'''''min precision''''' specifies the minimum precision to round to.
*'''''wiki''''' specifies whether the names of the units should be wikified or not and can take values of either ''yes'' or ''no''. The default value is ''no''.


Capitalization of the parameters is unimportant.
Ordinarily produces: {{Mi2 to Km2|mi2|km2|switch|round|link|magn}}


==See also==
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).
*{{tl|Km2 to Mi2}}
:'''Example''':<nowiki>{{Mi2 to Km2|250}}</nowiki>
*{{tl|Convert}}
:*'''Produces''':{{Mi2 to Km2|250}}
 
 
Setting ''switch'' to any non-empty value causes the metric value to be displayed first.
:'''Example''':<nowiki>{{Mi2 to Km2|250||switch}}</nowiki>
:*'''Produces''':{{Mi2 to Km2|250||switch}}
 
Set ''round'' to define the degree of rounding (e.g. '''1''' for one decimal place).
:'''Example''':<nowiki>{{Mi2 to Km2|250|||3}}</nowiki>
:*'''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]].
:'''Example''':<nowiki>{{Mi2 to Km2|250||||yes}}</nowiki>
:*'''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²]]).
:'''Example''':<nowiki>{{Mi2 to Km2|250||||yes|f00}}</nowiki>
:*'''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 -->
[[Category:Conversion templates|Mi2km2]]
</includeonly>

Revision as of 00:16, 15 June 2009


Usage

This template was created exclusively as a subtemplate for {{Infobox Settlement}}.

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).

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||||yes}}

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||||yes|f00}}

This template is primarily designed for infoboxes.

See also

  • {{convert}} (for use in article text)