Template:Currency/doc: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(Add more examples) |
(Add some documentation for new args) |
||
Line 7:
!Code
!Visible result
|-
|<nowiki>{{Currency|0}}</nowiki>
|{{Currency|0}}
|-
|<nowiki>{{Currency|100}}</nowiki>
Line 29 ⟶ 32:
|{{Currency|400300200100}}
|-
|<nowiki>{{Currency|-1}}</nowiki>
|{{Currency|-1}}
|-
|<nowiki>{{Currency|-400000200000}}</nowiki>
|{{Currency|-400300200100}}
|-
|<nowiki>{{Currency|2*(8/4)}}</nowiki>
|{{Currency|2*(8/4)}}
|}
===force_sign===
Force a sign in front of the currency.
{{T|Currency|200100|force_sign=yes}}: {{Currency|200100|force_sign=yes}}
{{T|Currency|-200100|force_sign=yes}}: {{Currency|-200100|force_sign=yes}} (no effect)
{{T|Currency|0|force_sign=yes}}: {{Currency|0|force_sign=yes}}
===all_signs===
Show the sign on all denominations
{{T|Currency|-200100|all_signs=yes}}: {{Currency|-200100|all_signs=yes}}
{{T|Currency|200100|all_signs=yes|force_sign=yes}}: {{Currency|200100|all_signs=yes|force_sign=yes}}
===show_zeroes===
After the first denomination is shown, show all smaller denominations even if there are zero of them
{{T|Currency|400000000000|show_zeroes=yes}}: {{Currency|400000000000|show_zeroes=yes}}
{{T|Currency|300000100|show_zeroes=yes}}: {{Currency|300000100|show_zeroes=yes}}
<includeonly>[[Category:Formatting templates]]</includeonly>
|
Revision as of 23:01, 19 November 2024
Template:Currency invokes function main in Module:Currency using Lua.
The currency template formats currency using the in-game icons.
Usage
Code | Visible result |
---|---|
{{Currency|0}} | 0 |
{{Currency|100}} | 100 |
{{Currency|200100}} | 200 100 |
{{Currency|300200100}} | 300 200 100 |
{{Currency|400300200100}} | 400 300 200 100 |
{{Currency|400000000000}} | 400 |
{{Currency|300000100}} | 300 0 100 |
{{Currency|400000200000}} | 400 300 200 100 |
{{Currency|-1}} | -1 |
{{Currency|-400000200000}} | -400 300 200 100 |
{{Currency|2*(8/4)}} | 4 |
force_sign
Force a sign in front of the currency.
{{Currency|200100|force_sign=yes}}
: +200 100
{{Currency|-200100|force_sign=yes}}
: -200 100 (no effect)
{{Currency|0|force_sign=yes}}
: ±0
all_signs
Show the sign on all denominations
{{Currency|-200100|all_signs=yes}}
: -200 -100
{{Currency|200100|force_sign=yes|all_signs=yes}}
: +200 +100
show_zeroes
After the first denomination is shown, show all smaller denominations even if there are zero of them
{{Currency|400000000000|show_zeroes=yes}}
: 400
{{Currency|300000100|show_zeroes=yes}}
: 300 0 100