Difference between revisions of "Template:Money"

From QBWiki
Jump to navigation Jump to search
(Created page with "{{#vardefine:money|{{{1|0}}}}}{{#if:{{#vardefineecho:cents|{{#explode:{{#var:money}}|.|1}}}}|{{#explode:{{#var:money}}|.|0}}.{{#sub:{{#var:cents}}{{#loop:i|0|{{#expr:2-{{#len:...")
 
(No difference)

Latest revision as of 15:31, 25 August 2022

0

For formatting dollar amounts in standard $XXXX.YY format.

  • Does not add commas
  • Will not add decimals if the number is whole
  • Truncates rather than rounds
Input Output
{{Money|1200}}
1200
{{Money|12.30}}
12.30
{{Money|11.3}}
11.30
{{Money|187.921}}
187.92
{{Money|9.}}
9.