Actions

Template

Difference between revisions of "JapanTax"

From Sonic Retro

(Created page with "{{#vardefine:priceonly|{{stripref|{{{1|}}}}}}}{{#vardefine:priceclean|{{#replace:{{#var:priceonly}}|,}}}}{{#switch:{{#sub:{{#var:priceonly}}|-1}} | i={{#replace:{{{1|}}}|{{#va...")
 
Line 1: Line 1:
{{#vardefine:priceonly|{{stripref|{{{1|}}}}}}}{{#vardefine:priceclean|{{#replace:{{#var:priceonly}}|,}}}}{{#switch:{{#sub:{{#var:priceonly}}|-1}}
+
{{#vardefine:priceonly|{{stripref|{{{1|}}}}}}}{{#vardefine:priceclean|{{#replace:{{#var:priceonly}}|,}}}}{{#switch:{{#var:priceonly}}|free={{{1|}}}|{{#switch:{{#sub:{{#var:priceonly}}|-1}}
 
| i={{#replace:{{{1|}}}|{{#var:priceonly}}|{{numformat|{{#expr:({{#explode:{{#var:priceclean}}|i|0}}/{{dateswitch|date={{{2|}}}|1.00|1989-04-01=1.03|1997-04-01=1.05|2014-04-01=1.08}}) round 0}}}} (''{{numformat|{{#replace:{{#var:priceclean}}|i}}}}'')}}
 
| i={{#replace:{{{1|}}}|{{#var:priceonly}}|{{numformat|{{#expr:({{#explode:{{#var:priceclean}}|i|0}}/{{dateswitch|date={{{2|}}}|1.00|1989-04-01=1.03|1997-04-01=1.05|2014-04-01=1.08}}) round 0}}}} (''{{numformat|{{#replace:{{#var:priceclean}}|i}}}}'')}}
 
| e={{#replace:{{{1|}}}|{{#var:priceonly}}|{{numformat|{{#replace:{{#var:priceclean}}|e}}}} (''{{numformat|{{#expr:({{#explode:{{#var:priceclean}}|e|0}}*{{dateswitch|date={{{2|}}}|1.00|1989-04-01=1.03|1997-04-01=1.05|2014-04-01=1.08}}) round 0}}}}'')}}
 
| e={{#replace:{{{1|}}}|{{#var:priceonly}}|{{numformat|{{#replace:{{#var:priceclean}}|e}}}} (''{{numformat|{{#expr:({{#explode:{{#var:priceclean}}|e|0}}*{{dateswitch|date={{{2|}}}|1.00|1989-04-01=1.03|1997-04-01=1.05|2014-04-01=1.08}}) round 0}}}}'')}}
 
| {{{1|}}}
 
| {{{1|}}}
}}<noinclude>
+
}}}}<noinclude>
 
==Usage==
 
==Usage==
 
<pre>{{JapanTax|PRICEi/PRICEe|DATE}}</pre>
 
<pre>{{JapanTax|PRICEi/PRICEe|DATE}}</pre>
Line 9: Line 9:
 
* <nowiki>{{JapanTax|1,500e|2017-07-07}}</nowiki> -> {{JapanTax|1,500e|2017-07-07}}
 
* <nowiki>{{JapanTax|1,500e|2017-07-07}}</nowiki> -> {{JapanTax|1,500e|2017-07-07}}
 
* <nowiki>{{JapanTax|2,800e|2008-07-07}}</nowiki> -> {{JapanTax|2,800e|2008-07-07}}
 
* <nowiki>{{JapanTax|2,800e|2008-07-07}}</nowiki> -> {{JapanTax|2,800e|2008-07-07}}
 +
* <nowiki>{{JapanTax|free|2008-07-07}}</nowiki> -> {{JapanTax|free|2008-07-07}}
  
 
Add "i" or "e" to the end of the price, if said price includes or excludes tax.
 
Add "i" or "e" to the end of the price, if said price includes or excludes tax.
  
 
[[Category:Sonic Retro templates]]</noinclude>
 
[[Category:Sonic Retro templates]]</noinclude>

Revision as of 15:22, 5 January 2019

Usage

{{JapanTax|PRICEi/PRICEe|DATE}}
  • {{JapanTax|1,620i|2017-07-07}} -> 1,500 (1,620)
  • {{JapanTax|1,500e|2017-07-07}} -> 1,500 (1,620)
  • {{JapanTax|2,800e|2008-07-07}} -> 2,800 (2,940)
  • {{JapanTax|free|2008-07-07}} -> free

Add "i" or "e" to the end of the price, if said price includes or excludes tax.