Template:Coindisplay: Difference between revisions

From IdleOn MMO Wiki
imported>Kiokurashi
No edit summary
(Attached documentation page to template.)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{#iferror: {{#expr: floor({{{1|0}}})}} | ? |<!--
<includeonly>{{#invoke:CoinDisplay|main}}</includeonly><noinclude>{{/doc}}</noinclude>
-->{{#vardefine: coin1 | {{#iferror: {{#expr: floor({{{1}}} div 100^0) mod 100 }} | 0}} }}<!--
-->{{#vardefine: coin2 | {{#iferror: {{#expr: floor({{{1}}} div 100^1) mod 100 }} | 0}} }}<!--
-->{{#vardefine: coin3 | {{#iferror: {{#expr: floor({{{1}}} div 100^2) mod 100 }} | 0}} }}<!--
-->{{#vardefine: coin4 | {{#iferror: {{#expr: floor({{{1}}} div 100^3) mod 100 }} | 0}} }}<!--
-->{{#vardefine: coin5 | {{#iferror: {{#expr: floor({{{1}}} div 100^4) mod 100 }} | 0}} }}<!--
-->{{#vardefine: coin6 | {{#iferror: {{#expr: floor({{{1}}} div 100^5) mod 100 }} | 0}} }}<!--
-->{{#vardefine: coin7 | {{#iferror: {{#expr: floor({{{1}}} div 100^6) mod 100 }} | 0}} }}<!--
-->{{#vardefine: coin8 | {{#iferror: {{#expr: floor({{{1}}} div 100^7) mod 100 }} | 0}} }}<!--
-->{{#vardefine: coin9 | {{#iferror: {{#expr: floor({{{1}}} div 100^8) mod 100 }} | 0}} }}<!--
-->{{#vardefine: coin10 | {{#iferror: {{#expr: floor({{{1}}} div 100^9)}} | 0}} }}<!--
 
-->{{#ifexpr: {{#var: coin10}} > 0 | [[File:Godshard Coin.png|link=]]{{#var: coin5}}}} <!--
-->{{#ifexpr: {{#var: coin9}} > 0 | [[File:Dreadlo Coin.png|link=]]{{#var: coin4}}}} <!--
-->{{#ifexpr: {{#var: coin8}} > 0 | [[File:Starfire Coin.png|link=]]{{#var: coin3}}}} <!--
-->{{#ifexpr: {{#var: coin7}} > 0 | [[File:Lustre Coin.png|link=]]{{#var: coin2}}}} <!--
-->{{#ifexpr: {{#var: coin6}} > 0 | [[File:Void Coin.png|link=]]{{#var: coin1}}}}<!--
-->{{#ifexpr: {{#var: coin5}} > 0 | [[File:Dementia Coin.png|link=]]{{#var: coin5}}}} <!--
-->{{#ifexpr: {{#var: coin4}} > 0 | [[File:Platinum Coin.png|link=]]{{#var: coin4}}}} <!--
-->{{#ifexpr: {{#var: coin3}} > 0 | [[File:Gold Coin.png|link=]]{{#var: coin3}}}} <!--
-->{{#ifexpr: {{#var: coin2}} > 0 | [[File:Silver Coin.png|link=]]{{#var: coin2}}}} <!--
-->{{#ifexpr: {{#var: coin1}} > 0 | [[File:Copper Coin.png|link=]]{{#var: coin1}}}}<!--
-->}}

Latest revision as of 23:03, 13 June 2024

The Coindisplay template displays the coin representation of a value.

Usage

{{Coindisplay|value}}

Parameters

  • value: The quantity to format. This can be specified in any of the formats supported by Module:NumberParser.

Examples

Template Result
{{Coindisplay|12750250}} Platinum Coin.png12 Gold Coin.png75 Silver Coin.png2 Copper Coin.png50
{{Coindisplay|2.7e15}} Starfire Coin.png27
{{Coindisplay|15T}} Lustre Coin.png15