Difference between revisions of "Template:Currency/old/doc"
< Template:Currency | old
Jump to navigation
Jump to search
imported>Margin1522 (make 1st column of table wider (15em) for better display of parameter names) |
imported>Margin1522 (Added parameter notes, based on "mediawiki Help:Magic_words" (formatnum) and Template:Currency/LongType) |
||
| Line 11: | Line 11: | ||
! Name !! Meaning | ! Name !! Meaning | ||
|- | |- | ||
| − | |style="width:15em;"| amount, Amount,<br>or the first unnamed parameter || The value to format as a currency number | + | |style="width:15em;"| amount, Amount,<br>or the first unnamed parameter<br>|| The value to format as a currency number.<br>The value may contain one decimal separator, which must be a period (example:12345.6).<br>The value should not contain group separators (commas or spaces). |
|- | |- | ||
| − | | type, Type,<br>or the second unnamed parameter || The type of currency to format the value as.<br>Most currencies are available through the use of the appropriate [[ISO 4217|ISO 4217 currency code]]. Some of the more popular currencies are also available by using the full name or popular abbreviations.<br>The default value is to format the value as the [[United States dollar]] (US$), in accordance with [[Wikipedia:Manual of Style (dates and numbers)#Currencies|the Manual of Style — Dates and Numbers — Currencies]] | + | | type, Type,<br>or the second unnamed parameter || The type of currency to format the value as.<br>Most currencies are available through the use of the appropriate [[ISO 4217|ISO 4217 currency code]]. Some of the more popular currencies are also available by using the full name or popular abbreviations.<br>The default value is to format the value as the [[United States dollar]] (US$), in accordance with [[Wikipedia:Manual of Style (dates and numbers)#Currencies|the Manual of Style — Dates and Numbers — Currencies]]. <br>Type values are case insensitive (example: "JPY" and "jpy" give the same result). |
|- | |- | ||
| first || if this parameter is present, with any value given, then the template will return a <value> <currency name> pair instead of the normal <linked symbol><value> pair. This is provided to comply with the first bullet point in the formatting section in [[Wikipedia:Manual of Style (dates and numbers)#Currencies|the Manual of Style — Dates and Numbers — Currencies]] | | first || if this parameter is present, with any value given, then the template will return a <value> <currency name> pair instead of the normal <linked symbol><value> pair. This is provided to comply with the first bullet point in the formatting section in [[Wikipedia:Manual of Style (dates and numbers)#Currencies|the Manual of Style — Dates and Numbers — Currencies]] | ||
| Line 24: | Line 24: | ||
*<nowiki>{{Currency|1000|AMD}}</nowiki> gives: {{Template:Currency|1000|AMD}} for the [[Armenian dram]] | *<nowiki>{{Currency|1000|AMD}}</nowiki> gives: {{Template:Currency|1000|AMD}} for the [[Armenian dram]] | ||
| − | Some of the more well known currencies also provide the ability to use common abbreviations or full names | + | Some of the more well known currencies also provide the ability to use common abbreviations or full names. |
*<nowiki>{{Currency|1000|US}}</nowiki> gives: {{Template:Currency|1000|us}} | *<nowiki>{{Currency|1000|US}}</nowiki> gives: {{Template:Currency|1000|us}} | ||
*<nowiki>{{Currency|1000|United States}}</nowiki> gives: {{Template:Currency|1000|United States}} | *<nowiki>{{Currency|1000|United States}}</nowiki> gives: {{Template:Currency|1000|United States}} | ||
| Line 37: | Line 37: | ||
*<nowiki>{{Currency|Amount=1000|quid|first=yes}}</nowiki> gives: {{Template:Currency|1000|quid|first=yes}} | *<nowiki>{{Currency|Amount=1000|quid|first=yes}}</nowiki> gives: {{Template:Currency|1000|quid|first=yes}} | ||
| − | The Krone currencies can be represented in two ways: | + | The Krone currencies (DKK, NOK, SEK) can be represented in two ways: |
| − | *<nowiki>{{Currency|1000|NOK}}</nowiki> gives: {{Currency|1000|NOK}} | + | *<nowiki>{{Currency|1000|NOK}}</nowiki> gives: {{Currency|1000|NOK}} – beware of ambiguity with Danish DKK ({{Currency|1000|DKK}}) and Swedish SEK ({{Currency|1000|SEK}}) |
*<nowiki>{{Currency|1000|NOK2}}</nowiki> gives: {{Currency|1000|NOK2}} | *<nowiki>{{Currency|1000|NOK2}}</nowiki> gives: {{Currency|1000|NOK2}} | ||
Revision as of 15:50, 12 October 2014
| This is a documentation subpage for Template:Currency/old. It contains usage information, categories and other content that is not part of the original template page. |
Formats a currency value with a link to the page about the currency and the appropriate symbol. The default is to show US$ value.
Usage
- {{Currency|1000}} gives: US$1,000
| Name | Meaning |
|---|---|
| amount, Amount, or the first unnamed parameter |
The value to format as a currency number. The value may contain one decimal separator, which must be a period (example:12345.6). The value should not contain group separators (commas or spaces). |
| type, Type, or the second unnamed parameter |
The type of currency to format the value as. Most currencies are available through the use of the appropriate ISO 4217 currency code. Some of the more popular currencies are also available by using the full name or popular abbreviations. The default value is to format the value as the United States dollar (US$), in accordance with the Manual of Style — Dates and Numbers — Currencies. Type values are case insensitive (example: "JPY" and "jpy" give the same result). |
| first | if this parameter is present, with any value given, then the template will return a <value> <currency name> pair instead of the normal <linked symbol><value> pair. This is provided to comply with the first bullet point in the formatting section in the Manual of Style — Dates and Numbers — Currencies |
Examples
Currencies other than the United States dollar can be found by using the appropriate ISO 4217 currency code
- {{Currency|1000|BMD}} gives: BD$1,000 for the Bermudian dollar
- {{Currency|1000|BDT}} gives: ৳1,000 for the Bangladeshi taka
- {{Currency|1000|AMD}} gives: ֏ 1,000 for the Armenian dram
Some of the more well known currencies also provide the ability to use common abbreviations or full names.
- {{Currency|1000|US}} gives: US$1,000
- {{Currency|1000|United States}} gives: US$1,000
- {{Currency|1000|JPY}} gives: ¥1,000
Parameter names can also be used, if preferred:
- {{Currency|amount=1000|type=US}} gives: US$1,000
- {{Currency|1000|type=us}} gives: {{currency}} – invalid amount (help)
- {{Currency|Amount=1000|euro}} gives: €1,000
The first use of a currency should show the value and the full name of the currency, so if the "first" parameter is defined then that is what will be given.
- {{Currency|Amount=1000|quid|first=yes}} gives: {{currency}} – invalid code (help)
The Krone currencies (DKK, NOK, SEK) can be represented in two ways:
- {{Currency|1000|NOK}} gives: kr 1,000 – beware of ambiguity with Danish DKK (kr. 1,000) and Swedish SEK (kr 1,000)
- {{Currency|1000|NOK2}} gives: NOK 1,000
See also
- {{Currency/Type}} is the Type sub-template.
- {{Currency/LongType}} is the LongType sub-template.
- Wikipedia:Manual of Style (dates and numbers)#Currencies for important usage pattern instructions.
- {{Format price}}, a template that handles rounding and "big number" formatting
- {{Inflation}}, a template that adjusts historical costs to current (or other-year) equivalent value
{{Infobox currency}}