Difference between revisions of "Template:FXConvert/Wordify"

From blackwiki
Jump to navigation Jump to search
imported>Trigenibinion
m (Trigenibinion moved page Draft:Template:FXConvert/Wordify to Template:FXConvert/Wordify: Publish)
imported>Trigenibinion
(Include documentation)
Line 1: Line 1:
<noinclude>This subtemplate will accept a number and output a formatted string with a smaller number and the divisor as a word in a number scaling system. For example, an input of 1010000 (with the [[short scale]] system and rounding to two decimal places) will result in an output of "1.01 billion".
+
<includeonly>{{#switch: {{{numsys|usa}}}
 
 
This template will factorise out trillion, billion and million from the given number for the short scale system. Use the <code>round</code> parameter to round the resulting number (e.g. <code>round=3</code> will yield 1.010 billion). Use the <code>numsys</code> parameter to choose the numbering system; currently, the supported arguments are <code>usa</code> for the [[short scale]] and <code>ind</code> for the [[Indian numbering system]].
 
The number output will be formatted to add decimal separators in the case of large numbers.
 
 
 
[[Category:Numbers as words conversion templates]]
 
 
 
</noinclude>{{#switch: {{{numsys|usa}}}
 
 
| usa = {{#ifexpr: {{{1|1}}}/1E12 >= 1
 
| usa = {{#ifexpr: {{{1|1}}}/1E12 >= 1
 
| {{formatnum:{{#expr: {{{1|1}}}/1E12 round {{{round|2}}}}}}} {{#ifeq:{{{lk|}}}|on|[[1,000,000,000,000|trillion]]|trillion}}
 
| {{formatnum:{{#expr: {{{1|1}}}/1E12 round {{{round|2}}}}}}} {{#ifeq:{{{lk|}}}|on|[[1,000,000,000,000|trillion]]|trillion}}
Line 27: Line 20:
 
}}
 
}}
 
}}
 
}}
| #default = number system not supported}}
+
| #default = number system not supported}}</includeonly><noinclude>{{Documentation}}</noinclude>

Revision as of 20:18, 16 January 2021

50px Template documentation[create]