Difference between revisions of "Template:Mapper Cost"

From Epic Paths
Jump to navigation Jump to search
(Created page with "<noinclude> Transforms an Gold Pieces float into a string of gp, sp or cp '''Examples:''' '''Examples:''' <nowiki>{{</nowiki>Mapper Cost|3.0}} = {{Mapper Cost|3.0}} <nowiki...")
 
 
Line 2: Line 2:
Transforms an Gold Pieces float into a string of gp, sp or cp
Transforms an Gold Pieces float into a string of gp, sp or cp


'''Examples:'''
'''Examples:'''
'''Examples:'''


Line 10: Line 9:


<nowiki>{{</nowiki>Mapper Cost|50.56}} = {{Mapper Cost|50.56}}
<nowiki>{{</nowiki>Mapper Cost|50.56}} = {{Mapper Cost|50.56}}
<nowiki>{{</nowiki>Mapper Cost|0.0}} = {{Mapper Cost|0.0}}


</noinclude><includeonly><!--
</noinclude><includeonly><!--


-->{{#ifexpr:floor({{{1}}}) = {{{1}}}|{{#number_format:{{{1}}}}} gp|<!--
-->{{#ifexpr:{{{1}}} = 0|—|<!--
  -->{{#ifexpr:{{{1}}} round 0 >= 1|{{#number_format:{{#expr:floor({{{1}}})}}}} gp|}} <!--
  -->{{#ifexpr:floor({{{1}}}) = {{{1}}}|{{#number_format:{{{1}}}}} gp|<!--
  -->{{#ifexpr:({{{1}}} - floor({{{1}}}))*10 round 0 >= 1|{{#number_format:{{#expr:floor(({{{1}}} - floor({{{1}}}))*10)}}}} sp|}} <!--
    -->{{#ifexpr:{{{1}}} round 0 >= 1|{{#number_format:{{#expr:floor({{{1}}})}}}} gp|}} <!--
  -->{{#ifexpr:({{{1}}}*10 - floor({{{1}}}*10))*10 round 0 >= 1|{{#number_format:{{#expr:floor(({{{1}}}*10 - floor({{{1}}}*10))*10)}}}} cp|}}<!--
    -->{{#ifexpr:({{{1}}} - floor({{{1}}}))*10 round 0 >= 1|{{#number_format:{{#expr:floor(({{{1}}} - floor({{{1}}}))*10)}}}} sp|}} <!--
    -->{{#ifexpr:({{{1}}}*10 - floor({{{1}}}*10))*10 round 0 >= 1|{{#number_format:{{#expr:floor(({{{1}}}*10 - floor({{{1}}}*10))*10)}}}} cp|}}<!--
  -->}}<!--
-->}}</includeonly>
-->}}</includeonly>

Latest revision as of 15:21, 29 January 2022

Transforms an Gold Pieces float into a string of gp, sp or cp

Examples:

{{Mapper Cost|3.0}} = 3 gp

{{Mapper Cost|0.30}} = 3 sp

{{Mapper Cost|50.56}} = 50 gp 5 sp 6 cp

{{Mapper Cost|0.0}} = —