Difference between revisions of "Currency"

From Sega Retro

m
 
(27 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<span style="display:none;">
 
 
{{#vardefine:prefix|{{#switch: {{{1}}}
 
{{#vardefine:prefix|{{#switch: {{{1}}}
| US=$
+
| US
 +
| AR
 +
| AU
 +
| CA
 +
| CL
 +
| CO
 +
| NZ
 +
| MX=$
 
| UK=£
 
| UK=£
 
| EU=€
 
| EU=€
| DE=DM  
+
| DE=DM&nbsp;
}}}}
+
| CN
{{#vardefine:suffix|{{#switch: {{{1}}}
+
| JP=¥
 +
| TW=NT$
 +
| BR=R$
 +
| NL=ƒ
 +
| KR=₩
 +
| IL=₪
 +
| IN=₹
 +
| TH=฿
 +
| MY=RM&nbsp;
 +
}}}}{{#vardefine:suffix|{{#switch: {{{1}}}
 
| FR=F
 
| FR=F
}}}}</span>{{#switch: {{{2}}}
+
| ES=Ptas
 +
| IT=£
 +
| SE
 +
| NO
 +
| DK=&nbsp;kr
 +
| FI=&nbsp;mk
 +
| RU=RUB
 +
| KW=KD
 +
| PT=PTE$
 +
| GR=₯
 +
| TR=₺
 +
| CZ=&nbsp;Kč
 +
| PL=PLN
 +
| SI=&nbsp;tolarjev
 +
| UA=₴
 +
| HU=&nbsp;Ft
 +
| BY=BYN
 +
}}}}{{#switch:{{#sub:{{{2}}}|0|4}}
 
| free=FREE
 
| free=FREE
| pack=PACK_IN
+
| pack=PACK-IN
| #default={{#var:prefix}}{{{2}}}{{#var:suffix}}
+
| #default={{#var:prefix}}{{#ifeq:{{{2}}}| |?|{{{2}}}}}{{#var:suffix}}
}}<noinclude>[[Category:Sega Retro templates]]</noinclude>
+
}}<noinclude>
 +
 
 +
A template to handle RRPs in a more automated way. Also to handle games sold for free or as console pack-ins.
 +
 
 +
Unfortunately it seems switch statements and tables don't mix well. I can't be bothered to fight it right now - feel free to jump in.
 +
 
 +
==Usage==
 +
<pre>{{currency|XX|PRICE}}</pre>
 +
[[Category:Templates]]</noinclude>

Latest revision as of 11:53, 2 June 2023

{{{2}}}

A template to handle RRPs in a more automated way. Also to handle games sold for free or as console pack-ins.

Unfortunately it seems switch statements and tables don't mix well. I can't be bothered to fight it right now - feel free to jump in.

Usage

{{currency|XX|PRICE}}