Template:Currency cell/doc: Difference between revisions

From Brighter Shores Wiki
Jump to navigation Jump to search
Content added Content deleted
(Add documentation for all args)
mNo edit summary
Line 93: Line 93:
|}
|}


<table class="wikitable">
<table class="wikitable"><!--
<thead>
--><tr><!--
--><th colspan="10">Head</th><!--
<tr>
--></tr><!--
<th colspan="10">Head</th>
-->{{Currency cell|1,000|html=yes}}<!-- Will output some text starting "<tr" and ending "</tr>"
</tr>
</thead>
--></table>
<tbody>
{{Currency cell|1,000|html=yes}} <!-- Will output some text starting "<th" and ending "</th>"
</tbody>
</table>
</syntaxhighlight>
</syntaxhighlight>


Line 112: Line 108:
|}
|}


<table class="wikitable">
<table class="wikitable"><!--
<thead>
--><tr><!--
--><th colspan="10">Head</th><!--
<tr>
--></tr><!--
<th colspan="10">Head</th>
-->{{Currency cell|1,000|html=yes}}<!-- Will output some text starting "<tr" and ending "</tr>"
</tr>
</thead>
--></table>
<tbody>
{{Currency cell|1,000|html=yes}} <!-- Will output some text starting "<th" and ending "</th>"
</tbody>
</table>

Revision as of 15:36, 20 November 2024

This is a documentation subpage for Template:Currency cell.
It contains usage information, categories, and other content that is not part of the original template page.
Template:Currency cell invokes function cell in Module:Currency using Lua.

Creates a table cell with a currency. These cells will always span 10 columns.

Usage

{| class="wikitable sortable"
! colspan="10" | Header
|-
| {{Currency cell|0}}
|-
| {{Currency cell|1000}}
|-
| {{Currency cell|1001}}
|-
| {{Currency cell|1}}
|-
| {{Currency cell|-1}}
|}
Header
0 Copper
1 Silver 0 Copper
1 Silver 1 Copper
1 Copper
-1 Copper

1

The first positional argument, the amount of currency (in copper coins).

This is either a comma-seperated number (like 1,000,000 for 1 gold) or an expression (like 6 * 10^6 / 3 for 2 gold)

force_sign

Force a sign in front of the currency.

Wikitext Output
{{Currency cell|200100|force_sign=yes}} +200 Silver 100 Copper
{{Currency cell|-200100|force_sign=yes}} -200 Silver 100 Copper
{{Currency cell|0|force_sign=yes}} ±0 Copper

sign

Three options:

  • sign=first (default): Put any sign on the first denomination only.
  • sign=all: Put the sign on all denominations.
  • sign=leading: Have a seperate aligned cell for any sign.
Amount sign=first sign=all sign=leading
1 1 Copper 1 Copper 1 Copper
-1 -1 Copper -1 Copper - 1 Copper
-2,000 -2 Silver 0 Copper -2 Silver -0 Copper - 2 Silver 0 Copper
-2,001 -2 Silver 1 Copper -2 Silver -1 Copper - 2 Silver 1 Copper
-3,002,001 -3 Gold 2 Silver 1 Copper -3 Gold -2 Silver -1 Copper - 3 Gold 2 Silver 1 Copper

extra_class

An arbitrary string to add as an extra class to all <td> cells.

html

With |html=yes, output html tags instead of wikitext.

For example,

{| class="wikitable"
! colspan="10" | Head
|-
| {{Currency cell|1,000|html=no}}
|}

<table class="wikitable"><!--
  --><tr><!--
    --><th colspan="10">Head</th><!--
  --></tr><!--
  -->{{Currency cell|1,000|html=yes}}<!-- Will output some text starting "<tr" and ending "</tr>"
--></table>


Head
1 Silver 0 Copper
Head
1Silver0Copper