Difference between revisions of "Template:Currency/Type/doc"
< Template:Currency | Type
Jump to navigation
Jump to search
imported>Ohms law (switch to template namespace) |
imported>SimonTrew (→Examples: Missing first parameter) |
||
| (9 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> | <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> | ||
| − | 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 | + | 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.'', <nowiki>[[United States dollar|US$]]</nowiki>. |
=== Usage === | === Usage === | ||
<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 | + | There is only one unnamed parameter used in this template, which finds the link from {{tlx|Currency/Link}} 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 empty, the result is as for <code>USD</code>. If the parameter is unknown, [[undefined behavior|behavior is undefined]]. |
| + | |||
| + | === 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|CNY}} || {{Currency/Type|CNY}} | ||
| + | |- | ||
| + | | {{tlc|Currency/Type|HUF}} || {{Currency/Type|HUF}} | ||
| + | |- | ||
| + | | {{tlc|Currency/Type|MYR}} || {{Currency/Type|MYR}} | ||
| + | |- | ||
| + | | {{tlc|Currency/Type|XYZ}} || {{Currency/Type|XYZ}} | ||
| + | |- | ||
| + | | {{tlc|Currency/Type|}} || {{Currency/Type|}} | ||
| + | |- | ||
| + | | {{tlc|Currency/Type}} || {{Currency/Type}} | ||
| + | |} | ||
=== See also === | === See also === | ||
| − | |||
<includeonly> | <includeonly> | ||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | <!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> | ||
| − | |||
</includeonly> | </includeonly> | ||
Latest revision as of 16:15, 30 November 2015
| 40px | This is a documentation subpage for Template:Currency/Type. It contains usage information, categories and other content that is not part of the original template page. |
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/Link}} 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 empty, the result is as for USD. If the parameter is unknown, behavior is undefined.
Examples
| Parameter | Result |
|---|---|
{{Currency/Type|GBP}} |
GB£ |
{{Currency/Type|EUR}} |
€ |
{{Currency/Type|USD}} |
US$ |
{{Currency/Type|CNY}} |
CN¥ |
{{Currency/Type|HUF}} |
Ft |
{{Currency/Type|MYR}} |
RM |
{{Currency/Type|XYZ}} |
|
{{Currency/Type|}} |
US$ |
{{Currency/Type}} |
US$ |