Difference between revisions of "MapPrice"
From P6 Spheres
| Line 32: | Line 32: | ||
-->{{#vardefine:CP|{{#ifeq:{{#var:CP}}|0||{{#var:CP}}}}}}<!-- | -->{{#vardefine:CP|{{#ifeq:{{#var:CP}}|0||{{#var:CP}}}}}}<!-- | ||
-->{{#if:{{#var:GP}}|{{#number_format:{{#var:GP}}|0|.|,}} gp}}<!-- | -->{{#if:{{#var:GP}}|{{#number_format:{{#var:GP}}|0|.|,}} gp}}<!-- | ||
| − | -->{{IfAnd|{{#var:GP}}|{{#var:SP}}|, | + | -->{{IfAnd|{{#var:GP}}|{{#var:SP}}|, }}<!-- |
-->{{#if:{{#var:SP}}|{{#var:SP}} sp}}<!-- | -->{{#if:{{#var:SP}}|{{#var:SP}} sp}}<!-- | ||
| − | -->{{IfAnd|{{#var:SP}}|{{#var:CP}}|, | + | -->{{IfAnd|{{#var:SP}}|{{#var:CP}}|, }}<!-- |
-->{{#if:{{#var:CP}}|{{#var:CP}} cp}}<!-- | -->{{#if:{{#var:CP}}|{{#var:CP}} cp}}<!-- | ||
-->}}<!-- | -->}}<!-- | ||
-->|{{{1|}}}<!-- | -->|{{{1|}}}<!-- | ||
-->}}</includeonly> | -->}}</includeonly> | ||
Latest revision as of 23:38, 22 March 2020
Accepts Float.
Returns String where float has been converted to a price:
Example: {{MapPrice|free}}: free
Example: {{MapPrice|0.0}}: —
Example: {{MapPrice|0.03}}: 3 cp
Example: {{MapPrice|0.2}}: 2 sp
Example: {{MapPrice|5.0}}: 5 gp
Example: {{MapPrice|2500.0}}: 2,500 gp
Example: {{MapPrice|3.3}}: 3 gp, 3 sp
Example: {{MapPrice|3.03}}: 3 gp3 cp
Example: {{MapPrice|3.33}}: 3 gp, 3 sp, 3 cp