Difference between revisions of "Template:Currency convert"

From Hitchwiki
Jump to navigation Jump to search
 
Line 3: Line 3:
 
|data=Rate=Rate
 
|data=Rate=Rate
 
|cache seconds=43200
 
|cache seconds=43200
}}
+
}}{{#expr:{{{3|1}}}*{{#external_value:Rate}} round 2}}{{#clear_external_data:}}<nowiki /></includeonly><noinclude>
{{#expr:{{{3|1}}}*{{#external_value:Rate}} round 2}}
+
This template uses Yahoo API to convert currencies.
{{#clear_external_data:}}</includeonly><noinclude>
 
This template uses Yahoo API to convert currencies.  
 
  
 
== Examples ==
 
== Examples ==
Line 12: Line 10:
 
<code><nowiki>{{Currency convert|CZK|PLN|32}}</nowiki></code> → {{Currency convert|CZK|PLN|32}}
 
<code><nowiki>{{Currency convert|CZK|PLN|32}}</nowiki></code> → {{Currency convert|CZK|PLN|32}}
  
Convert 1 Romanian leu to Hungarian forint<br />
+
Convert 1 Romanian leu to Hungarian forint:<br />
 
<code><nowiki>{{Currency convert|RON|HUF}}</nowiki></code> → {{Currency convert|RON|HUF}}
 
<code><nowiki>{{Currency convert|RON|HUF}}</nowiki></code> → {{Currency convert|RON|HUF}}
 +
 +
For conversions to euros or US dollars you can also use [[Template:To EUR]] and [[Template:To USD]]:<br />
 +
<code><nowiki>{{To EUR|PLN|10}}</nowiki></code> → {{To EUR|PLN|10}}
 +
 +
[[Category:Templates]]
 +
</noinclude>

Revision as of 22:08, 24 November 2014

This template uses Yahoo API to convert currencies.

Examples

Convert 32 Czech korunas to Polish zloty:
{{Currency convert|CZK|PLN|32}}Error: No contents found at URL https://query.yahooapis.com/v1/public/yql?q=select%20Rate%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22CZKPLN%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys.Expression error: Unexpected < operator.

Convert 1 Romanian leu to Hungarian forint:
{{Currency convert|RON|HUF}}Error: No contents found at URL https://query.yahooapis.com/v1/public/yql?q=select%20Rate%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22RONHUF%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys.Expression error: Unexpected < operator.

For conversions to euros or US dollars you can also use Template:To EUR and Template:To USD:
{{To EUR|PLN|10}}Error: No contents found at URL https://query.yahooapis.com/v1/public/yql?q=select%20Rate%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22PLNEUR%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys.Expression error: Unexpected < operator.