Actions

Template

Difference between revisions of "MapPrice"

From P6 Spheres

(Created page with "<noinclude>Accepts Float. Returns String where float has been converted to a price: Example: <nowiki>{{MapPrice|0.03}}</nowiki>: {{MapPrice|0.03}} Example: <nowiki>{{MapPri...")
 
Line 2: Line 2:
  
 
Returns String where float has been converted to a price:
 
Returns String where float has been converted to a price:
 +
 +
Example: <nowiki>{{MapPrice|0.0}}</nowiki>: {{MapPrice|0.0}}
  
 
Example: <nowiki>{{MapPrice|0.03}}</nowiki>: {{MapPrice|0.03}}
 
Example: <nowiki>{{MapPrice|0.03}}</nowiki>: {{MapPrice|0.03}}
Line 12: Line 14:
 
</noinclude><includeonly><!--
 
</noinclude><includeonly><!--
  
GP -->{{#ifexpr:{{#expr:{{{1|}}} >= 1.0}}|{{#number_format:{{{1|}}}|0|.|,}} gp<!--
+
0  -->{{#ifexpr:{{#expr:{{{1|}}} = 0.0}}|—<!--
SP  -->|{{#ifexpr:{{#expr:{{{1|}}} >= 0.1}}|{{#expr: {{{1|}}} * 10}} sp<!--
+
  GP -->|{{#ifexpr:{{#expr:{{{1|}}} >= 1.0}}|{{#number_format:{{{1|}}}|0|.|,}} gp<!--
CP    -->|{{#expr: {{{1|}}} * 100}} cp<!--
+
  SP  -->|{{#ifexpr:{{#expr:{{{1|}}} >= 0.1}}|{{#expr: {{{1|}}} * 10}} sp<!--
 +
  CP    -->|{{#expr: {{{1|}}} * 100}} cp<!--
 +
      -->}}<!--
 
     -->}}<!--
 
     -->}}<!--
 
   -->}}<!--
 
   -->}}<!--
  
 
--></includeonly>
 
--></includeonly>

Revision as of 08:39, 16 March 2020

Accepts Float.

Returns String where float has been converted to a price:

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