Misplaced Pages

Template:Exchange rate/doc: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< Template:Exchange rate Browse history interactively← Previous editContent deleted Content addedVisualWikitext
Revision as of 14:05, 26 April 2015 editGadget850 (talk | contribs)115,579 edits <!-- Categories below this line, please; interwikis at Wikidata -->← Previous edit Latest revision as of 07:56, 1 June 2023 edit undoWOSlinker (talk | contribs)Administrators855,556 editsm syntaxhighlight lang="wikitext" 
(18 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{Documentation subpage}} {{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see ]) -->
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->


==Instruction== ==Usage==
It is very easy to use this template. You will know right away when you see this example: This template only requires the currency code. Place it in the first parameter, as in the following example:
<syntaxhighlight lang="wikitext">
<pre>
{{Exchange rate|TWD}} {{Exchange rate|TWD}}
</syntaxhighlight>
</pre>


which produces which produces
Line 15: Line 15:


===Additional currencies=== ===Additional currencies===
You may also specify up to 3 additional foreign currencies. You may also specify up to three additional foreign currencies.


<syntaxhighlight lang="wikitext">
<pre>
{{Exchange rate|SGD|MYR|CNY|IDR}} {{Exchange rate|SGD|MYR|THB|IDR}}
</syntaxhighlight>
</pre>


produces produces


<div style="padding: 10px; border: 1px dashed #2f6fab;"> <div style="padding: 10px; border: 1px dashed #2f6fab;">
{{Exchange rate|SGD|MYR|CNY|IDR}} {{Exchange rate|SGD|MYR|THB|IDR}}
</div> </div>


===Alternative layouts=== ===Alternative layouts===
If you don't like navbox style you can specify <tt>style = h3<tt> or <tt>style = h2<tt> which produces something more like standard text. Using <tt>header = h3<tt> or <tt>header = h2<tt> also have the same effect. If you don't like navbox style you can specify <kbd>style = h3</kbd> or <kbd>style = h2</kbd> which produces something more like standard text. Using <kbd>header = h3</kbd> or <kbd>header = h2</kbd> also have the same effect.


<syntaxhighlight lang="wikitext">
<pre>
{{Exchange rate|EUR|style=h3}} {{Exchange rate|EUR|style=h3}}
</syntaxhighlight>
</pre>


produces produces


{{Exchange rate|EUR|style=h3}} {{Exchange rate|EUR|style=h3}}
The {{para|style}} parameter overrides the {{para|header}} parameter, but not vice versa. Thus, if the template is called with <tt>header = h3<tt> but <tt>style = navbox<tt>, it will display as a navbox. If it is called with <tt>header = h3<tt> and no specification for {{para|style}}, on the other hand, {{para|header}} will be used and it will show up as text instead of as a nabvox. The {{para|style}} parameter overrides the {{para|header}} parameter, but not vice versa. Thus, if the template is called with <kbd>header = h3</kbd> but <kbd>style = navbox</kbd>, it will display as a navbox. If it is called with <kbd>header = h3</kbd> and no specification for {{para|style}}, on the other hand, {{para|header}} will be used and it will show up as text instead of as a nabvox.




You may specify <tt>header = h3<tt> or <tt>header = h2<tt> so that the mock header looks like the level 3 header or level 2 header, respectively. By default, the template displays like a navbox. This template currently only supports an overridden mock headers 2 and 3, not level 4, 5, or 6. You may specify <kbd>header = h3</kbd> or <kbd>header = h2</kbd> so that the mock header looks like the level 3 header or level 2 header, respectively. By default, the template displays like a navbox. This template currently only supports an overridden mock headers 2 and 3, not level 4, 5, or 6.


<syntaxhighlight lang="wikitext">
<pre>
{{Exchange rate|EUR|header = h3}} {{Exchange rate|EUR|header = h3}}
</syntaxhighlight>
</pre>


produces produces
Line 56: Line 56:
* ] : currency converter with pocket guide * ] : currency converter with pocket guide
* ] : currency converter and 10 years history charts * ] : currency converter and 10 years history charts
* ] : currency converter, pocket guide, live exchange rates, with history since 1990 * OANDA : currency converter, pocket guide, live exchange rates, with history since 1990
* fxtop : exchange rates from central banks, daily historical rates and charts from 1953, currency converter (10 currencies at the same time), cross exchange rates, world map and pocket guide
* Currency.Wiki : currency converter with option to convert multiple currencies using current and/or historical rates as well as export feature into TXT or XLS file example http://awesomescreenshot.com/0e34lmom81


== Caveat == == Caveat ==
* "Current XYZ exchange rates" looks like a section title, but it's not. This was done to "remove" the edit links on the right so that people won't accidentally change the template. However, the side-effect of that is the font size won't change in {{abbr|IE|Internet Explorer}} (at least IE&nbsp;6) if I enlarge or shrink my font size. * While "Current XYZ exchange rates" maintains the appearance of a section heading, it is not. This was done to avoid having a section-edit link on the right so that people won't accidentally change the template. However, the side effect of that is the font size won't change in {{abbr|IE|Internet Explorer}} (at least IE&nbsp;6) when enlarging or shrinking the text size.


==Choice of currencies== ==Choice of currencies==
Currently, the 8 default currencies listed here are ]'s benchmark currencies . Currently, the list include 9 default currencies. They are the top 9 most traded currencies in the world, according to ] . Most of them are also part of ]'s benchmark currencies list . They also represent top 8 official foreign exchange reserve in the world according to ] .


=== See also === == Template data ==
{{TemplateData header}}
<templatedata>
{
"params": {
"1": {
"label": "Currency code",
"description": "The currency code to be used in this template.",
"type": "string",
"required": true
},
"2": {
"label": "Additional currency",
"description": "Additional currency that will have links to exchange rate, such as a currency of a neighboring country that are not among the default ones.",
"type": "string"
},
"3": {
"label": "Second additional currency",
"description": "Additional currency that will have links to exchange rate, such as a currency of a neighboring country that are not among the default ones.",
"type": "string"
},
"4": {
"label": "Third additional currency",
"description": "Additional currency that will have links to exchange rate, such as a currency of a neighboring country that are not among the default ones.",
"type": "string"
},
"style": {
"aliases": [
"layout"
],
"label": "Layout",
"description": "Specify an alternative layout to use instead of a navbox.",
"type": "string"
},
"header": {
"label": "Header style",
"description": "Specify a header level to use. An alternative layout will be automatically used unless \"Layout\" parameter is set to navbox.",
"type": "string"
},
"note": {
"label": "Note",
"description": "Add an additional note at the bottom of this template.",
"type": "unknown"
}
},
"description": "Display a table link to exchange rates between a currency to one of the top 9 most traded currencies in the world, and, optionally, three other currencies.",
"paramOrder": [
"1",
"2",
"3",
"4",
"style",
"header",
"note"
],
"format": "inline"
}
</templatedata>

== See also ==
* ] * ]
* ] * ]
* ] * ]


<includeonly> <includeonly>{{Sandbox other||
<!-- Categories below this line, please; interwikis at Wikidata --> <!-- Categories below this line, please; interwikis at Wikidata -->
] ]
] ]

]
</includeonly> }}</includeonly>

Latest revision as of 07:56, 1 June 2023

This is a documentation subpage for Template:Exchange rate.
It may contain usage information, categories and other content that is not part of the original template page.

Usage

This template only requires the currency code. Place it in the first parameter, as in the following example:

{{Exchange rate|TWD}}

which produces

Current TWD exchange rates
From Google Finance: AUD CAD CHF CNY EUR GBP HKD JPY USD
From Yahoo! Finance: AUD CAD CHF CNY EUR GBP HKD JPY USD
From XE.com: AUD CAD CHF CNY EUR GBP HKD JPY USD
From OANDA: AUD CAD CHF CNY EUR GBP HKD JPY USD

Additional currencies

You may also specify up to three additional foreign currencies.

{{Exchange rate|SGD|MYR|THB|IDR}}

produces

Current SGD exchange rates
From Google Finance: AUD CAD CHF CNY EUR GBP HKD JPY USD MYR THB IDR
From Yahoo! Finance: AUD CAD CHF CNY EUR GBP HKD JPY USD MYR THB IDR
From XE.com: AUD CAD CHF CNY EUR GBP HKD JPY USD MYR THB IDR
From OANDA: AUD CAD CHF CNY EUR GBP HKD JPY USD MYR THB IDR

Alternative layouts

If you don't like navbox style you can specify style = h3 or style = h2 which produces something more like standard text. Using header = h3 or header = h2 also have the same effect.

{{Exchange rate|EUR|style=h3}}

produces

Current EUR exchange rates

From Google Finance: AUD CAD CHF CNY GBP HKD JPY USD
From Yahoo! Finance: AUD CAD CHF CNY GBP HKD JPY USD
From XE.com: AUD CAD CHF CNY GBP HKD JPY USD
From OANDA: AUD CAD CHF CNY GBP HKD JPY USD

The |style= parameter overrides the |header= parameter, but not vice versa. Thus, if the template is called with header = h3 but style = navbox, it will display as a navbox. If it is called with header = h3 and no specification for |style=, on the other hand, |header= will be used and it will show up as text instead of as a nabvox.


You may specify header = h3 or header = h2 so that the mock header looks like the level 3 header or level 2 header, respectively. By default, the template displays like a navbox. This template currently only supports an overridden mock headers 2 and 3, not level 4, 5, or 6.

{{Exchange rate|EUR|header = h3}}

produces

Current EUR exchange rates

From Google Finance: AUD CAD CHF CNY GBP HKD JPY USD
From Yahoo! Finance: AUD CAD CHF CNY GBP HKD JPY USD
From XE.com: AUD CAD CHF CNY GBP HKD JPY USD
From OANDA: AUD CAD CHF CNY GBP HKD JPY USD

Sites managed

  • Google finance : live exchange rates with history since mid 2003
  • Yahoo! Finance : currency converter with pocket guide
  • XE : currency converter and 10 years history charts
  • OANDA : currency converter, pocket guide, live exchange rates, with history since 1990

Caveat

  • While "Current XYZ exchange rates" maintains the appearance of a section heading, it is not. This was done to avoid having a section-edit link on the right so that people won't accidentally change the template. However, the side effect of that is the font size won't change in IE (at least IE 6) when enlarging or shrinking the text size.

Choice of currencies

Currently, the list include 9 default currencies. They are the top 9 most traded currencies in the world, according to Bank for International Settlements . Most of them are also part of Bloomberg's benchmark currencies list . They also represent top 8 official foreign exchange reserve in the world according to International Monetary Fund .

Template data

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Exchange rate in articles based on its TemplateData.

TemplateData for Exchange rate

Display a table link to exchange rates between a currency to one of the top 9 most traded currencies in the world, and, optionally, three other currencies.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Currency code1

The currency code to be used in this template.

Stringrequired
Additional currency2

Additional currency that will have links to exchange rate, such as a currency of a neighboring country that are not among the default ones.

Stringoptional
Second additional currency3

Additional currency that will have links to exchange rate, such as a currency of a neighboring country that are not among the default ones.

Stringoptional
Third additional currency4

Additional currency that will have links to exchange rate, such as a currency of a neighboring country that are not among the default ones.

Stringoptional
Layoutstyle layout

Specify an alternative layout to use instead of a navbox.

Stringoptional
Header styleheader

Specify a header level to use. An alternative layout will be automatically used unless "Layout" parameter is set to navbox.

Stringoptional
Notenote

Add an additional note at the bottom of this template.

Unknownoptional

See also