Template:Money: Difference between revisions
B4ttl3m4st3r (talk | contribs) No edit summary |
mNo edit summary |
||
Line 12: | Line 12: | ||
<pre> | <pre> | ||
pp = Math.floor(value / 10000); | pp = Math.floor(value / 10000); | ||
gp = Math.floor((value - pp * 10000) / 100); | gp = Math.floor(((value - pp) * 10000)) / 100); | ||
cp = value - pp * 10000 - gp * 100; | cp = value - pp * 10000 - gp * 100; | ||
</pre> | </pre> | ||
Line 19: | Line 19: | ||
<span class="template_money">{{#ifexpr: {{{showZeros|1}}} or floor({{{value|0}}} / 10000) > 0|{{#expr: floor({{{value|0}}} / 10000)}} https://cdn.fhxrestoration.com/common/interface/icons/coins_pp.gif}} | <span class="template_money">{{#ifexpr: {{{showZeros|1}}} or floor({{{value|0}}} / 10000) > 0|{{#expr: floor({{{value|0}}} / 10000)}} https://cdn.fhxrestoration.com/common/interface/icons/coins_pp.gif}} | ||
{{#ifexpr: {{{showZeros|1}}} or floor(({{{value|0}}} - floor({{{value|0}}} / 10000) * 10000) / 100) > 0|{{#expr: floor(({{{value|0}}} - floor({{{value|0}}} / 10000) * 10000) / 100)}} https://cdn.fhxrestoration.com/common/interface/icons/coins_gp.gif}} | {{#ifexpr: {{{showZeros|1}}} or floor(({{{value|0}}} - floor({{{value|0}}} / 10000) * 10000) / 100) > 0|{{#expr: floor(({{{value|0}}} - floor({{{value|0}}} / 10000) * 10000) / 100)}} https://cdn.fhxrestoration.com/common/interface/icons/coins_gp.gif}} | ||
{{#ifexpr: {{{showZeros|1}}} or floor({{{value|0}}} - floor({{{value|0}}} / 10000) * 10000 - floor(({{{value|0}}} - floor({{{value|0}}} / 10000) * 10000) / 100) * 100) > 0|{{#expr: floor({{{value|0}}} - floor({{{value|0}}} / 10000) * 10000 - floor(({{{value|0}}} - floor({{{value|0}}} / 10000) * 10000) / 100) * 100)}} https://cdn.fhxrestoration.com/common/interface/icons/coins_cp.gif }}{{#ifexpr: {{{showSum|1}}}| ({{{value|0}}})}}</span> | {{#ifexpr: {{{showZeros|1}}} or floor({{{value|0}}} - floor({{{value|0}}} / 10000) * 10000 - floor((({{{value|0}}} - floor({{{value|0}}} / 10000)) * 10000) / 100) * 100) > 0|{{#expr: floor({{{value|0}}} - floor({{{value|0}}} / 10000) * 10000 - floor(({{{value|0}}} - floor({{{value|0}}} / 10000) * 10000) / 100) * 100)}} https://cdn.fhxrestoration.com/common/interface/icons/coins_cp.gif }}{{#ifexpr: {{{showSum|1}}}| ({{{value|0}}})}}</span> |
Revision as of 22:34, 20 June 2024
This is the "Money" template. It should be transcluded in the following format:
{{Money |value= |showZeros= |showSum= }}
The input value is separated into the 3 different currencies as follow:
pp = Math.floor(value / 10000); gp = Math.floor(((value - pp) * 10000)) / 100); cp = value - pp * 10000 - gp * 100;
0 0 0 (0)