Template:Money: Difference between revisions
B4ttl3m4st3r (talk | contribs) No edit summary |
B4ttl3m4st3r (talk | contribs) No edit summary |
||
Line 5: | Line 5: | ||
{{Money | {{Money | ||
|value= | |value= | ||
|showZeros= | |||
}} | }} | ||
</pre> | </pre> | ||
Line 13: | Line 14: | ||
cp = value - pp * 10000 - gp * 100; | cp = value - pp * 10000 - gp * 100; | ||
</pre> | </pre> | ||
</noinclude> | </noinclude> | ||
<templatestyles src="Money/styles.css" /> | <templatestyles src="Money/styles.css" /> | ||
<span class="root"> | <span class="root"> | ||
{{#expr: floor({{{value | | {{#ifexpr: {{{showZeros | 1}}} or floor({{{value | 0}}} / 10000) > 0 | {{#expr: floor({{{value | 0}}} / 10000)}} https://cdn.fhxrestoration.com/common/interface/icons/coins_pp.gif }} | ||
{{#expr: floor(({{{value | | {{#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 }} | ||
{{#expr: {{{value | | {{#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_pp.gif }} | ||
</span> | </span> |
Revision as of 09:27, 9 June 2024
This is the "Money" template. It should be transcluded in the following format:
{{Money |value= |showZeros= }}
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