टेम्पलेट:Currency
This template uses Lua: |
Formats a currency value with the appropriate symbol which is linked to the article about the currency. When a particular currency is not specified, the template's default is to show the amount as a United States dollar value.
Usage
[संपादन करीं]Using unnamed parameters:
{{currency|value|code|first=y|linked=no}}
Using named parameters:
{{currency|amount=value|code=code|first=y|linked=no}}
where:
- value is a number with or without comma separators; may be followed by an optional quantifier: 'thousand', 'million', 'M', 'billion', 'B', or 'trillion'
- code is an ISO 4217 currency code or one of the supported non-standard codes listed below
|first=
when set to any value produces a long-form currency name|linked=
when set to 'no' disables wikilinks on the rendered currency symbol or long-form currency name
Note: mixed use of named and unnamed parameters may produce unexpected results. In this example, the template expects the first unnamed parameter to be a value number:
{{Currency|amount=1000|GBP}}
- {{currency}} – invalid amount (help)
When using parameter names, |amount=
and |code=
are preferred. The template will also accept |Amount=
and |type=
and |Type=
.
Supported non-standard currency codes
[संपादन करीं]Codes that can be translated to ISO 4217 currencies
[संपादन करीं]These non-standard codes are aliases of standard ISO 4217 codes.
- EGE
- EU
- EUMELN
- EURO
- FRW
- KNAAK
- KSH
- NEP
- POUND
- POUND STERLING
- RMB
- TEURO
- THE SINGLE CURRENCY
- TSH
- UK
- UNITED STATES
- US
- U.S.
- USA
- USH
Other non-standard codes
[संपादन करीं]These codes either do not have a matching ISO 4217 currency code or are alternate versions of existing ISO 4217 codes or support unique aspects of a currency.
- BITCOIN – no matching ISO 4217 code
- BTC – no matching ISO 4217 code
- DKK2 – alternate version of DKK
- FRF – historical
- GRD – historical
- LSL2 – plural version of LSL
- LTL – historical
- NOK2 – alternate version of NOK
- SEK2 – alternate version of SEK
- SZL2 – plural version of SZL
- XBT – no matching ISO 4217 code
उदाहरण
[संपादन करीं]Currencies other than the United States dollar can be rendered 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|1,000|JPY}} gives: ¥1,000
Parameter names can also be used, if preferred:
Negative amount:
- {{Currency|amount=-1000|code=US}} gives: US$−1,000
Text quantifiers:
- {{Currency|1000 million|code=euro}} gives: €1,000,000,000
- {{Currency|1000M|code=euro}} gives: €1,000,000,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|1000|cve|first=yes}} gives: 1,000 Cape Verde escudos
- {{Currency|1000|cve}} gives: 1.000$00
Because the symbol for the currencies DKK, NOK, and SEK may be ambiguous, these may be represented in two ways:
- For DKK:
- For NOK:
- For SEK:
Similarly, some currencies use different symbols for single and plural amounts:
Error messages
[संपादन करीं]{{currency}}
can produce several error message. These are:
- {{currency}} – invalid code – the value in the second unnamed parameter or assigned to
|code=
cannot be found in the template's list of codes. Make sure that the assigned code is a correct ISO 4217 currency code or one of the supported non-standard codes listed above. - {{currency}} – invalid amount – the value in the first unnamed parameter or assigned to
|amount=
contains one or more characters that is not a minus sign, a digit, comma, or decimal point, or has some text that is not one of the permitted quantifiers. Make sure that comma separators group three digits and that the number has only one decimal point. Make sure that the amount and code parameters are either both named (|amount=
and|code=
) or both unnamed. - {{currency}} – definition missing position – an internal error that should only occur when an editor is mucking about in Module:Currency/Presentation. It indicates that Module:Currency doesn't know where to place the currency's symbol in relation to its value.
- {{currency}} – definition missing page – an internal error that should only occur when an editor is mucking about in Module:Currency/Presentation. It indicates that Module:Currency doesn't have a page that it can use to link the currency's symbol or name.
इहो देखल जाय
[संपादन करीं]- 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}}
परिचय खातिर ऊपर दिहल गइल बिबरनलेख के टेम्पलेट:Currency/doc से ट्रांसक्लूड क के इहाँ देखावल जा रहल बाटे। (संपादन करीं | इतिहास देखीं) संपादक लोग एह टेम्पलेट के अभ्यासपन्ना (सैंडबाक्स) (बनाईं | मिरर करीं) आ टेस्टकेस (बनाईं) पन्ना सभ पर अभ्यास आ प्रयोग (टेस्टिंग) क सकत बाटे। अनुरोध बा कि अगर श्रेणी जोड़े के होखे तब /doc उपपन्ना (सबपेज) पर जोड़ल जाय। एह टेम्पलेट के उपपन्ना (सबपेज) देखीं। |