Template:Currency/doc: Difference between revisions

From Brighter Shores Wiki
Jump to navigation Jump to search
Content added Content deleted
(Add more examples)
(Add some documentation for new args)
Line 7: Line 7:
!Code
!Code
!Visible result
!Visible result
|-
|<nowiki>{{Currency|0}}</nowiki>
|{{Currency|0}}
|-
|-
|<nowiki>{{Currency|100}}</nowiki>
|<nowiki>{{Currency|100}}</nowiki>
Line 29: Line 32:
|{{Currency|400300200100}}
|{{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>
<includeonly>[[Category:Formatting templates]]</includeonly>

Revision as of 23:01, 19 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|-400000200000}} -400 Platinum 300 Gold 200 Silver 100 Copper
{{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_zeroes

After the first denomination is shown, show all smaller denominations even if there are zero of them

{{Currency|400000000000|show_zeroes=yes}}: 400 Platinum

{{Currency|300000100|show_zeroes=yes}}: 300 Gold 0 Silver 100 Copper