پرش به محتوا

الگو:Currency

از ویکی‌پدیا، دانشنامهٔ آزاد

US$۰

توضیحات الگو[نمایش] [ویرایش] [تاریخچه] [پاکسازی]

Formats a currency value with a link to the page about the currency and the appropriate symbol. The default is to show US$ value.

استفاده

[ویرایش]
  • {{Currency|1000}} خروجی: US$۱٬۰۰۰
پارامترها
نام مفهوم
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 دلار آمریکا (US$).
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 Manual of Style — Dates and Numbers — Currencies, which states "Link the first occurrence of lesser-known currencies (توگروگs)".

نمونه‌ها

[ویرایش]

Currencies other than the دلار آمریکا can be found by using the appropriate ISO 4217 currency code

Some of the more well known currencies also provide the ability to use common abbreviations or full names.

  • {{Currency|1000|US}} gives: US$۱٬۰۰۰
  • {{Currency|1000|United States}} gives: US$۱٬۰۰۰
  • {{Currency|1000|JPY}} gives: ¥۱٬۰۰۰

Parameter names can also be used, if preferred:

  • {{Currency|amount=1000|type=US}} gives: US$۱٬۰۰۰
  • {{Currency|1000|type=us}} gives: US$۱٬۰۰۰
  • {{Currency|Amount=1000|euro}} gives: ۱٬۰۰۰

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: ۱٬۰۰۰ یورو

The Krone currencies (DKK, NOK, SEK) can be represented in two ways:

  • {{Currency|1000|NOK}} gives: kr ۱٬۰۰۰ – beware of ambiguity with Danish DKK (kr ۱٬۰۰۰) and Swedish SEK (kr ۱٬۰۰۰)
  • {{Currency|1000|NOK2}} gives: NOK ۱٬۰۰۰

جستارهای وابسته

[ویرایش]