Template:Currency/doc: Difference between revisions

From Brighter Shores Wiki
Jump to navigation Jump to search
Content added Content deleted
(Add some documentation for new args)
(Document changed show_zeros arg)
Line 35:
|{{Currency|-1}}
|-
|<nowiki>{{Currency|-4000002000004,003,002,001,000}}</nowiki>
|{{Currency|-4003002001004,003,002,001,000}}
|-
|<nowiki>{{Currency|2*(8/4)}}</nowiki>
Line 58:
{{T|Currency|200100|all_signs=yes|force_sign=yes}}: {{Currency|200100|all_signs=yes|force_sign=yes}}
 
===show_zeroesshow_zeros===
Three options:
After the first denomination is shown, show all smaller denominations even if there are zero of them
* <code>show_zeros=some</code> (default): show the zero valued denominations between the biggest and smallest denomination
* <code>show_zeros=all</code>: show all zeros after the first denomination up to copper
* <code>show_zeros=none</code>: hide all denominations with zero value
 
{| class="wikitable"
{{T|Currency|400000000000|show_zeroes=yes}}: {{Currency|400000000000|show_zeroes=yes}}
! Amount
 
! <code>show_zeros=some</code>
{{T|Currency|300000100|show_zeroes=yes}}: {{Currency|300000100|show_zeroes=yes}}
! <code>show_zeros=all</code>
! <code>show_zeros=none</code>
|-
| 0 || {{Currency|0|show_zeros=some}} || {{Currency|0|show_zeros=all}} || {{Currency|0|show_zeros=all}}
|-
| 1 || {{Currency|1|show_zeros=some}} || {{Currency|1|show_zeros=all}} || {{Currency|1|show_zeros=all}}
|-
| 2,000 || {{Currency|2000|show_zeros=some}} || {{Currency|2000|show_zeros=all}} || {{Currency|2000|show_zeros=all}}
|-
| 2,001 || {{Currency|2001|show_zeros=some}} || {{Currency|2001|show_zeros=all}} || {{Currency|2001|show_zeros=all}}
|-
| 3,002,000 || {{Currency|3002000|show_zeros=some}} || {{Currency|3002000|show_zeros=all}} || {{Currency|3002000|show_zeros=all}}
|-
| 4,000,002,000 || {{Currency|4000002000|show_zeros=some}} || {{Currency|4000002000|show_zeros=all}} || {{Currency|4000002000|show_zeros=all}}
|}
 
<includeonly>[[Category:Formatting templates]]</includeonly>

Revision as of 15:00, 20 November 2024

This is a documentation subpage for Template:Currency.
It contains usage information, categories, and other content that is not part of the original template page.
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}} Copper
{{Currency|100}} 100 Copper
{{Currency|200100}} 200 Silver 100 Copper
{{Currency|300200100}} 300 Gold 200 Silver 100 Copper
{{Currency|400300200100}} 400 Platinum 300 Gold 200 Silver 100 Copper
{{Currency|400000000000}} 400 Platinum
{{Currency|300000100}} 300 Gold 0 Silver 100 Copper
{{Currency|400000200000}} 400 Platinum 300 Gold 200 Silver 100 Copper
{{Currency|-1}} -1 Copper
{{Currency|-4,003,002,001,000}} -4003 Platinum 2 Gold 1 Silver
{{Currency|2*(8/4)}} Copper

force_sign

Force a sign in front of the currency.

{{Currency|200100|force_sign=yes}}: +200 Silver 100 Copper

{{Currency|-200100|force_sign=yes}}: -200 Silver 100 Copper (no effect)

{{Currency|0|force_sign=yes}}: ±0 Copper

all_signs

Show the sign on all denominations

{{Currency|-200100|all_signs=yes}}: -200 Silver -100 Copper

{{Currency|200100|force_sign=yes|all_signs=yes}}: +200 Silver +100 Copper

show_zeros

Three options:

  • show_zeros=some (default): show the zero valued denominations between the biggest and smallest denomination
  • show_zeros=all: show all zeros after the first denomination up to copper
  • show_zeros=none: hide all denominations with zero value
Amount show_zeros=some show_zeros=all show_zeros=none
0 Copper Copper Copper
1 Copper Copper Copper
2,000 Silver Silver 0 Copper Silver 0 Copper
2,001 Silver 1 Copper Silver 1 Copper Silver 1 Copper
3,002,000 Gold 2 Silver Gold 2 Silver 0 Copper Gold 2 Silver 0 Copper
4,000,002,000 Platinum 0 Gold 2 Silver Platinum 0 Gold 2 Silver 0 Copper Platinum 0 Gold 2 Silver 0 Copper