Difference between revisions of "Template:Currency/Type/doc"

From blackwiki
Jump to navigation Jump to search
imported>Hydrargyrum
m (update to reflect change to template (United States Dollar --> United States dollar))
imported>SimonTrew
(→‎Usage: Give examples)
Line 6: Line 6:
 
<span style="font-weight:bold; background-color:Seashell">Note: <span style="color:orange;">This template should generally not be used alone.</span></span>
 
<span style="font-weight:bold; background-color:Seashell">Note: <span style="color:orange;">This template should generally not be used alone.</span></span>
  
There is only one unnamed parameter used in this template, which is matched against a switch\case structure to find the value to output. Note that any value given to it is converted to upper case before processing for matches, so this template does not distinguish between "United States" and "UNITED STATES", for example.
+
There is only one unnamed parameter used in this template, which finds the link from {{tlx|Currency/LongType}} and the symbol from {{tlx|Currency/Symbol}}. Note that any value given to it is converted to upper case before processing for matches, so this template does not distinguish between "United States" and "UNITED STATES", for example. If the parameter is unknown, the result is undefined. If the parameter is empty, the result is as for <code>USD</code>.
 +
 
 +
=== Examples ===
 +
{| class="wikitable"
 +
! scope="col" | Parameter !! scope="col" | Result
 +
|-
 +
| {{tlc|Currency/Type|GBP}} || {{Currency/Type|GBP}}
 +
|-
 +
| {{tlc|Currency/Type|EUR}} || {{Currency/Type|EUR}}
 +
|-
 +
| {{tlc|Currency/Type|USD}} || {{Currency/Type|USD}}
 +
|-
 +
| {{tlc|Currency/Type|XYZ}} || {{Currency/Type|XYZ}}
 +
|-
 +
| {{tlc|Currency/Type|}} || {{Currency/Type|}}
 +
|}
  
 
=== See also ===
 
=== See also ===

Revision as of 12:41, 30 November 2015

This is the type sub-template to Template:Currency. The Type sub-template converts the value it is given to the appropriate linked currency name, e.g., [[United States dollar|US$]].

Usage

Note: This template should generally not be used alone.

There is only one unnamed parameter used in this template, which finds the link from {{Currency/LongType}} and the symbol from {{Currency/Symbol}}. Note that any value given to it is converted to upper case before processing for matches, so this template does not distinguish between "United States" and "UNITED STATES", for example. If the parameter is unknown, the result is undefined. If the parameter is empty, the result is as for USD.

Examples

Parameter Result
{{Currency/Type|GBP}} GB£
{{Currency/Type|EUR}}
{{Currency/Type|USD}} US$
{{Currency/Type|XYZ}}
{{Currency/Type|}} US$

See also