Template:Currency/doc: Difference between revisions
(Document changed show_zeros arg) |
(Decimal examples) |
||
(One intermediate revision by the same user not shown) | |||
Line 8: | Line 8: | ||
!Visible result |
!Visible result |
||
|- |
|- |
||
| |
|{{T|Currency|0}} |
||
|{{Currency|0}} |
|{{Currency|0}} |
||
|- |
|- |
||
| |
|{{T|Currency|100}} |
||
|{{Currency|100}} |
|{{Currency|100}} |
||
|- |
|- |
||
| |
|{{T|Currency|200100}} |
||
|{{Currency|200100}} |
|{{Currency|200100}} |
||
|- |
|- |
||
| |
|{{T|Currency|300200100}} |
||
|{{Currency|300200100}} |
|{{Currency|300200100}} |
||
|- |
|- |
||
| |
|{{T|Currency|400300200100}} |
||
|{{Currency|400300200100}} |
|{{Currency|400300200100}} |
||
|- |
|- |
||
| |
|{{T|Currency|400000000000}} |
||
|{{Currency|400000000000}} |
|{{Currency|400000000000}} |
||
|- |
|- |
||
| |
|{{T|Currency|300000100}} |
||
|{{Currency|300000100}} |
|{{Currency|300000100}} |
||
|- |
|- |
||
| |
|{{T|Currency|400000200000}} |
||
|{{Currency|400300200100}} |
|{{Currency|400300200100}} |
||
|- |
|- |
||
| |
|{{T|Currency|-1}} |
||
|{{Currency|-1}} |
|{{Currency|-1}} |
||
|- |
|- |
||
| |
|{{T|Currency|-4,003,002,001,000}} |
||
|{{Currency|-4,003,002,001,000}} |
|{{Currency|-4,003,002,001,000}} |
||
|- |
|- |
||
| |
|{{T|Currency|2*(8/4)}} |
||
|{{Currency|2*(8/4)}} |
|{{Currency|2*(8/4)}} |
||
|- |
|||
| {{T|Currency|0.5}} |
|||
| {{Currency|0.5}} |
|||
|- |
|||
| {{T|Currency|1/3 round 2}} |
|||
| {{Currency|1/3 round 2}} |
|||
|} |
|} |
||
Line 70: | Line 76: | ||
! <code>show_zeros=none</code> |
! <code>show_zeros=none</code> |
||
|- |
|- |
||
| 0 || {{Currency|0|show_zeros=some}} || {{Currency|0|show_zeros=all}} || {{Currency|0|show_zeros= |
| 0 || {{Currency|0|show_zeros=some}} || {{Currency|0|show_zeros=all}} || {{Currency|0|show_zeros=none}} |
||
|- |
|- |
||
| 1 || {{Currency|1|show_zeros=some}} || {{Currency|1|show_zeros=all}} || {{Currency|1|show_zeros= |
| 1 || {{Currency|1|show_zeros=some}} || {{Currency|1|show_zeros=all}} || {{Currency|1|show_zeros=none}} |
||
|- |
|- |
||
| 2,000 || {{Currency|2000|show_zeros=some}} || {{Currency|2000|show_zeros=all}} || {{Currency|2000|show_zeros= |
| 2,000 || {{Currency|2000|show_zeros=some}} || {{Currency|2000|show_zeros=all}} || {{Currency|2000|show_zeros=none}} |
||
|- |
|- |
||
| 2,001 || {{Currency|2001|show_zeros=some}} || {{Currency|2001|show_zeros=all}} || {{Currency|2001|show_zeros= |
| 2,001 || {{Currency|2001|show_zeros=some}} || {{Currency|2001|show_zeros=all}} || {{Currency|2001|show_zeros=none}} |
||
|- |
|- |
||
| 3,002,000 || {{Currency|3002000|show_zeros=some}} || {{Currency|3002000|show_zeros=all}} || {{Currency|3002000|show_zeros= |
| 3,002,000 || {{Currency|3002000|show_zeros=some}} || {{Currency|3002000|show_zeros=all}} || {{Currency|3002000|show_zeros=none}} |
||
|- |
|- |
||
| 4,000,002,000 || {{Currency|4000002000|show_zeros=some}} || {{Currency|4000002000|show_zeros=all}} || {{Currency|4000002000|show_zeros= |
| 4,000,002,000 || {{Currency|4000002000|show_zeros=some}} || {{Currency|4000002000|show_zeros=all}} || {{Currency|4000002000|show_zeros=none}} |
||
|} |
|} |
||
Latest revision as of 16:58, 20 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|-4,003,002,001,000}}
|
-4003 2 1 |
{{Currency|2*(8/4)}}
|
4 |
{{Currency|0.5}}
|
0.5 |
{{Currency|1/3 round 2}}
|
0.33 |
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_zeros
Three options:
show_zeros=some
(default): show the zero valued denominations between the biggest and smallest denominationshow_zeros=all
: show all zeros after the first denomination up to coppershow_zeros=none
: hide all denominations with zero value
Amount | show_zeros=some
|
show_zeros=all
|
show_zeros=none
|
---|---|---|---|
0 | 0 | 0 | 0 |
1 | 1 | 1 | 1 |
2,000 | 2 | 2 0 | 2 |
2,001 | 2 1 | 2 1 | 2 1 |
3,002,000 | 3 2 | 3 2 0 | 3 2 |
4,000,002,000 | 4 0 2 | 4 0 2 0 | 4 2 |