跳转到内容

Template:CADConvert

本页使用了标题或全文手工转换
维基百科,自由的百科全书


文档图示 模板文档[查看] [编辑] [历史] [清除缓存]


介绍

[编辑]

机制/原理

[编辑]

用法

[编辑]

参数

[编辑]
Field name Usage Example Description
value mandatory 10000.01 The value, in the country_code currency, that needs to be converted. The template will not accept pre-formatted values (i.e. 1,234).
currency_units optional m Used to represent smaller or larger numbers. Available options are as follows.
  • ct – to represent cent(s)
  • p – to represent penny (pence)
  • pa – to represent paisa (paise) (generalized to mean cents)
  • po – to represent poysha (generalized to mean cents)
  • ba – to represent baisa(s) (generalized to mean 1/1000)
  • k – to represent thousand(s)
  • m – to represent million(s)
  • b – to represent short scale billion(s)
  • t – to represent short scale trillion(s)
  • l – to represent lakh(s)
  • c – to represent crore(s)
  • lc – to represent lakh crore(s)
  • Brackets in the sense may be singular (or) plural.

The Indian units can be applied to any currency.

lk optional lk=on This parameter gives you the option of internally linking currency names (paise, which is generalized here to mean cents in the source currency) and/or number names (billion, trillion, lakh, crore). By default, the parameter is set to "off" (i.e. it is set not to link). Available options are as follows.
  • on – to link all units
  • source – to link the source value
  • original – to link the values in the original currency
  • inflated – to link the inflated value in the original currency
  • result – to link the inflated and converted vales
  • converted – to link the converted value
  • source-converted – to link the source and converted values
year optional year=2002 This parameter allows entering values from previous years. The year will be displayed and historic values will be inflated to the latest year available in {{Inflation}} if index is also provided then converted by {{ToUSD}}. If no index name is present, the conversion will be attempted for the year indicated (but see force). If year is not provided, just a conversion will be performed at the most current rate available.
to optional to=EUR This parameter allows for conversion to various different currencies. Currently, the USD (default) and the euro are supported.
r optional r=3 Sets the digits to which the results must be rounded. A negative value indicates rounding to an upper significant digit, and a positive value indicates a fractional digit including trailing zeros. Defaults to 2.
force optional force=yes This parameter allows to force a conversion at the most current rate available when data is lacking for the provided year when its value is yes.
exact optional exact=source This provides some control over formatting. source requests to display the input value normally (in American fashion) after applying the units. on does this for both the input and result values. Otherwise all values will be displayed as per {{Format price}}.
showdate optional showdate=no This allows to disable displaying the original year.
ref optional ref=<ref>some wikitext ref</ref> This allows displaying one or more references next to the original value. Each one must consist of a ref wikitext element.
mode optional mode=historical This parameter controls the output mode. Setting it to blank or omitting it results in the default mode. Setting it to historical allows conversion using historical exchange rates.
convert optional convert=no This parameter controls the currency conversion. Setting it to blank or omitting it results in the default mode. Setting it to no disables it.

示例

[编辑]
CADConvert syntax Results
{{CADConvert|1|ct|lk=on}} 加拿大元0.01 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|10|ct}} 加拿大元0.1 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|ct|exact=source}} 加拿大元0.01 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|10|ct|exact=source}} 加拿大元0.1 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|ct|exact=on}} 加拿大元0.01 (US$""年份數據未定義)
{{CADConvert|10|ct|exact=on}} 加拿大元0.1 (US$""年份數據未定義)
{{CADConvert|1|ct|year=2002}} 加拿大元0.01(2002年) (相当于2020年的加元0.01   or US$0.01)[1]
{{CADConvert|10|ct|year=2002}} 加拿大元0.1(2002年) (相当于2020年的加元0.14   or US$0.1)[1]
{{CADConvert|1|ct|year=2002|mode=historical}} 加拿大元0.01(2002年) (US$0.01)
{{CADConvert|10|ct|year=2002|mode=historical}} 加拿大元0.1(2002年) (US$0.06)
{{CADConvert|1|ct|year=2002|lk=on}} 加拿大元0.01(2002年) (相当于2020年的加元0.01   or US$0.01)[1]
{{CADConvert|10|ct|year=2002|lk=on}} 加拿大元0.1(2002年) (相当于2020年的加元0.14   or US$0.1)[1]
{{CADConvert|1|ct|year=2002|exact=on}} 加拿大元0.01(2002年) (相当于2020年的加元0.01   or US$0.01)[1]
{{CADConvert|10|ct|year=2002|exact=on}} 加拿大元0.1(2002年) (相当于2020年的加元0.14   or US$0.1)[1]
{{CADConvert|1|ct|lk=on|convert=no}} 加拿大元0.01
{{CADConvert|10|ct|convert=no}} 加拿大元0.1
{{CADConvert|1|ct|exact=source|convert=no}} 加拿大元0.01
{{CADConvert|10|ct|exact=source|convert=no}} 加拿大元0.1
{{CADConvert|1|ct|exact=on|convert=no}} 加拿大元0.01
{{CADConvert|10|ct|exact=on|convert=no}} 加拿大元0.1
{{CADConvert|1|ct|year=2002|convert=no}} 加拿大元0.01(2002年) (相当于2020年的加元0.01)[1]
{{CADConvert|10|ct|year=2002|convert=no}} 加拿大元0.1(2002年) (相当于2020年的加元0.14)[1]
{{CADConvert|1|ct|year=2002|mode=historical|convert=no}} 加拿大元0.01(2002年)
{{CADConvert|10|ct|year=2002|mode=historical|convert=no}} 加拿大元0.1(2002年)
{{CADConvert|1|ct|year=2002|lk=on|convert=no}} 加拿大元0.01(2002年) (相当于2020年的加元0.01)[1]
{{CADConvert|10|ct|year=2002|lk=on|convert=no}} 加拿大元0.1(2002年) (相当于2020年的加元0.14)[1]
{{CADConvert|1|ct|year=2002|exact=on|convert=no}} 加拿大元0.01(2002年) (相当于2020年的加元0.01)[1]
{{CADConvert|10|ct|year=2002|exact=on|convert=no}} 加拿大元0.1(2002年) (相当于2020年的加元0.14)[1]
{{CADConvert|1}} 加拿大元1 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|k}} 加拿大元1,000 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|m}} 加拿大元1 million (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|b|lk=on}} 加拿大元1 billion (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|t|lk=on}} 加拿大元1 trillion (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|exact=source}} 加拿大元1 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|k|exact=source}} 加拿大元1,000 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|m|exact=source}} 加拿大元1,000,000 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|b|exact=source}} 加拿大元1,000,000,000 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|t|exact=source}} 加拿大元1,000,000,000,000 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|1|exact=on}} 加拿大元1 (US$""年份數據未定義)
{{CADConvert|1|k|exact=on}} 加拿大元1,000 (US$""年份數據未定義)
{{CADConvert|1|m|exact=on}} 加拿大元1,000,000 (US$""年份數據未定義)
{{CADConvert|1|b|exact=on}} 加拿大元1,000,000,000 (US$""年份數據未定義)
{{CADConvert|1|t|exact=on}} 加拿大元1,000,000,000,000 (US$""年份數據未定義)
{{CADConvert|1|year=2002}} 加拿大元1(2002年) (相当于2020年的加元1.37   or US$1.02)[1]
{{CADConvert|1|k|year=2002}} 加拿大元1,000(2002年) (相当于2020年的加元1,370   or US$1,021.51)[1]
{{CADConvert|1|m|year=2002}} 加拿大元1 million(2002年) (相当于2020年的加元1.37 million   or US$1.02 million)[1]
{{CADConvert|1|b|year=2002}} 加拿大元1 billion(2002年) (相当于2020年的加元1.37 billion   or US$1.02 billion)[1]
{{CADConvert|1|t|year=2002}} 加拿大元1 trillion(2002年) (相当于2020年的加元1.37 trillion   or US$1.02 trillion)[1]
{{CADConvert|1|year=2002|lk=on}} 加拿大元1(2002年) (相当于2020年的加元1.37   or US$1.02)[1]
{{CADConvert|1|k|year=2002|lk=on}} 加拿大元1,000(2002年) (相当于2020年的加元1,370   or US$1,021.51)[1]
{{CADConvert|1|m|year=2002|lk=on}} 加拿大元1 million(2002年) (相当于2020年的加元1.37 million   or US$1.02 million)[1]
{{CADConvert|1|b|year=2002|lk=on}} 加拿大元1 billion(2002年) (相当于2020年的加元1.37 billion   or US$1.02 billion[1]
{{CADConvert|1|t|year=2002|lk=on}} 加拿大元1 trillion(2002年) (相当于2020年的加元1.37 trillion   or US$1.02 trillion[1]
{{CADConvert|3.60}} 加拿大元3.6 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|360}} 加拿大元360 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|3600}} 加拿大元3,600 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|360000}} 加拿大元360,000 (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|3600000}} 加拿大元3.6 million (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|3.6|m}} 加拿大元3.6 million (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|3650000}} 加拿大元3.65 million (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|3.65|m}} 加拿大元3.65 million (US$FXConvert/Wordify error: cannot parse value """年份數據未定義")
{{CADConvert|3650000|year=1914}} 加拿大元3.65 million(1914年) (相当于2020年的加元83.34 million   or US$62.14 million)[1]
{{CADConvert|3.65|m|year=1914}} 加拿大元3.65 million(1914年) (相当于2020年的加元83.34 million   or US$62.14 million)[1]
{{CADConvert|3650000|year=1914|exact=source}} 加拿大元3,650,000(1914年) (相当于2020年的加元83.34 million   or US$62.14 million)[1]
{{CADConvert|3.65|m|year=1914|exact=source}} 加拿大元3,650,000(1914年) (相当于2020年的加元83.34 million   or US$62.14 million)[1]
{{CADConvert|3650000|year=1914|force=yes}} 加拿大元3.65 million(1914年) (相当于2020年的加元83.34 million   or US$62.14 million)[1]
{{CADConvert|3.65|m|year=1914|force=yes}} 加拿大元3.65 million(1914年) (相当于2020年的加元83.34 million   or US$62.14 million)[1]
{{CADConvert|3650000|year=1914|force=yes|exact=on}} 加拿大元3,650,000(1914年) (相当于2020年的加元83,341,666.67   or US$62,141,819.05)[1]
{{CADConvert|3.65|m|year=1914|force=yes|exact=on}} 加拿大元3,650,000(1914年) (相当于2020年的加元83,341,666.67   or US$62,141,819.05)[1]
{{CADConvert|3650000|year=2002}} 加拿大元3.65 million(2002年) (相当于2020年的加元5 million   or US$3.73 million)[1]
{{CADConvert|3.65|m|year=2002}} 加拿大元3.65 million(2002年) (相当于2020年的加元5 million   or US$3.73 million)[1]
{{CADConvert|3650000|year=2002|exact=on}} 加拿大元3,650,000(2002年) (相当于2020年的加元5,000,500   or US$3,728,509.14)[1]
{{CADConvert|3.65|m|year=2002|exact=on}} 加拿大元3,650,000(2002年) (相当于2020年的加元5,000,500   or US$3,728,509.14)[1]
{{CADConvert|3650000|year=2002|exact=source}} 加拿大元3,650,000(2002年) (相当于2020年的加元5 million   or US$3.73 million)[1]
{{CADConvert|3.65|m|year=2002|exact=source}} 加拿大元3,650,000(2002年) (相当于2020年的加元5 million   or US$3.73 million)[1]
{{CADConvert|3650000|year=2002|exact=on}} 加拿大元3,650,000(2002年) (相当于2020年的加元5,000,500   or US$3,728,509.14)[1]
{{CADConvert|3.65|m|year=2002|exact=on}} 加拿大元3,650,000(2002年) (相当于2020年的加元5,000,500   or US$3,728,509.14)[1]
{{CADConvert|3600000|year=1962|ref=<ref name="qv">http://www.westcoastferries.ca/ferries/bcferries/queenofvancouver.html</ref>}} 加拿大元3.6 million(1962年)[2] (相当于2020年的加元31.02 million   or US$23.13 million)[1]
{{CADConvert|3600000|year=1962|ref=<ref name="qv">http://www.westcoastferries.ca/ferries/bcferries/queenofvancouver.html</ref><ref>something</ref>}} 加拿大元3.6 million(1962年)[2][3] (相当于2020年的加元31.02 million   or US$23.13 million)[1]
{{CADConvert|3600000|year=2011|to=EUR|ref=<ref name="S1">something1</ref>}} 加拿大元3.6 million(2011年)[4] (相当于2020年的加元4.12 million   or 2.69 million)[1]
{{CADConvert|3600000|year=2011|to=EUR|showdate=no|ref=<ref name="S1">something1</ref>}} 加拿大元3.6 million[4] (相当于2020年的加元4.12 million   or 2.69 million)[1]

注意事项

[编辑]

重定向

[编辑]

参见

[编辑]

给模板编辑者的说明

[编辑]

模板结构

[编辑]
以下是该模板的模板数据,适用于可视化编辑器等工具。

CADConvert模板数据

Template calculates a value of Canadian dollars, which you can enter, to US dollars and then presents the results.

模板参数

参数描述类型状态
Value1

The value, in the source, that needs to be converted. The template will not accept pre-formatted values (i.e. 1,234).

示例值
500000000
数字必需
Currency units2

Use this to represent larger numbers such as crores, billions et al.

示例值
c, lc, b, m, k, cr, p, pa, po, ba
单行文本推荐
Linkinglk

Gives option to whether link currency names (paise, etc.) or number names (crores, lakhs, billions, trillions)

示例值
on, off, source, original, inflated, result, converted, source-converted
单行文本推荐
Yearyear

This parameter allows for inflation. Historic values will be inflated to the most current values available then converted.

示例值
2015
数字推荐
Toto

This parameter allows for conversion to various different currencies. The USD (default) and the euro are currently supported.

默认值
USD
示例值
EUR
未知可选
Rounding digitsr

Used to round significant digits. A value of "0" will drop paise or cent values from the converted number. By default the conversion will be rounded to two significant figures.

示例值
0
数字可选
Forceforce

This parameter allows to force a conversion at the most current rate available when data is lacking for the provided year when its value is "yes".

示例值
yes
单行文本可选
Exactexact

This provides some control over formatting. "source" requests to display the input value normally (in American fashion) after applying the units. "on" does this for both the input and result values. Otherwise all values will be displayed as per Format price.

示例值
source, on
单行文本可选
Show dateshowdate

This allows to disable displaying the original year.

示例值
no
单行文本可选
Referencesref

This allows displaying one or more references next to the original value. Each one must consist of a ref wikitext element.

示例值
<ref>some wikitext ref</ref>
内容推荐
Modemode

This parameter allows for the control of the output mode. Currently, blank (default) and historical are supported. In historical mode, conversions are performed using a historical exchange rate, for the year supplied.

默认值
(blank)
示例值
historical
单行文本可选
Convertconvert

This parameter controls the currency conversion. Setting it to blank or omitting it results in the default mode. Setting it to <code>no</code> disables it.

默认值
(blank)
示例值
no
单行文本可选

实现方法

[编辑]

编辑注意

[编辑]