Template:Cost

From Turtle WoW Wiki
Revision as of 03:50, 21 January 2022 by >Aeliren (Created page with "<onlyinclude><includeonly><span class="nobreak ajaxoutertt">{{#sub:<!-- ### ACTUAL CURRENCY ### Gold -->{{#if:{{{g|{{{1|}}}}}}| {{#replace:{{{g|{{{1}}}}}}|x| }}<spa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Description
This template is designed to represent the most common forms of currency: the set of gold, silver, and copper.
All other items that are used as currency, tokens, and quest objectives should use {{{{#if:|{{{prefix}}}:}}costitem{{#if:cost||<cost>}}{{#if:actual item||<actual item>}}{{#if:display name/desired link||<display name/desired link>}}{{#if:||<{{{5}}}>}}{{#if:||<{{{6}}}>}}{{#if:||<{{{7}}}>}}{{#if:||<{{{8}}}>}}{{#if:||<{{{9}}}>}}{{#if:||<{{{10}}}>}}{{#if:||<{{{11}}}>}}{{#if:||<{{{12}}}>}}{{#if:||<{{{13}}}>}}{{#if:||<{{{14}}}>}}{{#if:||<{{{15}}}>}}{{#if:||<{{{16}}}>}}{{#if:||<{{{17}}}>}}{{#if:||<{{{18}}}>}}{{#if:||<{{{19}}}>}}{{#if:||<{{{20}}}>}}{{#if:||<{{{21}}}>}}}} instead of this template.
  • Base currency
    • Copper () - c
    • Silver () - s
    • Gold () - g
Syntax
{{{{#if:|{{{prefix}}}:}}Cost{{#if:gold||<gold>}}{{#if:silver||<silver>}}{{#if:copper||<copper>}}{{#if:g=||<g=>}}{{#if:s=||<s=>}}{{#if:c=||<c=>}}{{#if:ach=||<ach=>}}{{#if:cs=||<cs=>}}{{#if:ca=||<ca=>}}{{#if:dca=||<dca=>}}{{#if:djt=||<djt=>}}{{#if:dpt=||<dpt=>}}{{#if:ijt=||<ijt=>}}{{#if:it=||<it=>}}{{#if:mwt=||<mwt=>}}{{#if:tbc=||<tbc=>}}{{#if:||<{{{18}}}>}}{{#if:||<{{{19}}}>}}{{#if:||<{{{20}}}>}}{{#if:||<{{{21}}}>}}}}
Example
{{cost|1||30}}
{{cost|2|3}}
{{cost||4|5}}
{{cost|||6}}
{{cost|eob=2}}
{{cost|it=5}}
Result
{{#sub:{{#if:1| {{#replace:1|x| }}g}}{{#if:| {{#replace:|x| }}s}}{{#if:30| {{#replace:30|x| }}c}}{{#if:| {{{cost}}} [[File:{{{icon}}}|16px|{{{name}}}|link={{{name}}}]]}}|5}}
{{#sub:{{#if:2| {{#replace:2|x| }}g}}{{#if:3| {{#replace:3|x| }}s}}{{#if:| {{#replace:{{{3}}}|x| }}c}}{{#if:| {{{cost}}} [[File:{{{icon}}}|16px|{{{name}}}|link={{{name}}}]]}}|5}}
{{#sub:{{#if:| {{#replace:|x| }}g}}{{#if:4| {{#replace:4|x| }}s}}{{#if:5| {{#replace:5|x| }}c}}{{#if:| {{{cost}}} [[File:{{{icon}}}|16px|{{{name}}}|link={{{name}}}]]}}|5}}
{{#sub:{{#if:| {{#replace:|x| }}g}}{{#if:| {{#replace:|x| }}s}}{{#if:6| {{#replace:6|x| }}c}}{{#if:| {{{cost}}} [[File:{{{icon}}}|16px|{{{name}}}|link={{{name}}}]]}}|5}}
{{#sub:{{#if:| {{#replace:{{{1}}}|x| }}g}}{{#if:| {{#replace:{{{2}}}|x| }}s}}{{#if:| {{#replace:{{{3}}}|x| }}c}}{{#if:| {{{cost}}} [[File:{{{icon}}}|16px|{{{name}}}|link={{{name}}}]]}}|5}}
{{#sub:{{#if:| {{#replace:{{{1}}}|x| }}g}}{{#if:| {{#replace:{{{2}}}|x| }}s}}{{#if:| {{#replace:{{{3}}}|x| }}c}}{{#if:| {{{cost}}} [[File:{{{icon}}}|16px|{{{name}}}|link={{{name}}}]]}}|5}}

Table usage

For tables that have a column filled with money, the gold, silver, and copper can be manually aligned by using the letter "x". Each "x" is replaced with a space that has the same width as a single digit, acting as a mini indent.

If a coin type is filled entirely with x's, that type's icon will additionally be made invisible.

Example
{| class="darktable zebra"
! Cost
|-
| {{cost|123|45|67}}
|-
| {{cost|xx1|x2|x3}}
|-
| {{cost|xxx|12}}
|-
| {{cost|xxx|xx|12}}
|}
Cost
{{#replace:123|x| }}g}}{{#if:45| {{#replace:45|x| }}s}}{{#if:67| {{#replace:67|x| }}c}}{{#if:| {{{cost}}} [[File:{{{icon}}}|16px|{{{name}}}|link={{{name}}}]]}}|5}}
{{#replace:xx1|x| }}g}}{{#if:x2| {{#replace:x2|x| }}s}}{{#if:x3| {{#replace:x3|x| }}c}}{{#if:| {{{cost}}} [[File:{{{icon}}}|16px|{{{name}}}|link={{{name}}}]]}}|5}}
{{#replace:xxx|x| }}g}}{{#if:12| {{#replace:12|x| }}s}}{{#if:| {{#replace:{{{3}}}|x| }}c}}{{#if:| {{{cost}}} [[File:{{{icon}}}|16px|{{{name}}}|link={{{name}}}]]}}|5}}
{{#replace:xxx|x| }}g}}{{#if:xx| {{#replace:xx|x| }}s}}{{#if:12| {{#replace:12|x| }}c}}{{#if:| {{{cost}}} [[File:{{{icon}}}|16px|{{{name}}}|link={{{name}}}]]}}|5}}

See also

  • {{{{#if:|{{{prefix}}}:}}coppercost{{#if:amount||<amount>}}{{#if:||<{{{3}}}>}}{{#if:||<{{{4}}}>}}{{#if:||<{{{5}}}>}}{{#if:||<{{{6}}}>}}{{#if:||<{{{7}}}>}}{{#if:||<{{{8}}}>}}{{#if:||<{{{9}}}>}}{{#if:||<{{{10}}}>}}{{#if:||<{{{11}}}>}}{{#if:||<{{{12}}}>}}{{#if:||<{{{13}}}>}}{{#if:||<{{{14}}}>}}{{#if:||<{{{15}}}>}}{{#if:||<{{{16}}}>}}{{#if:||<{{{17}}}>}}{{#if:||<{{{18}}}>}}{{#if:||<{{{19}}}>}}{{#if:||<{{{20}}}>}}{{#if:||<{{{21}}}>}}}} — show an amount of money given as a number copper coins.
  • {{{{#if:|{{{prefix}}}:}}costcopper{{#if:g||<g>}}{{#if:s||<s>}}{{#if:c||<c>}}{{#if:||<{{{5}}}>}}{{#if:||<{{{6}}}>}}{{#if:||<{{{7}}}>}}{{#if:||<{{{8}}}>}}{{#if:||<{{{9}}}>}}{{#if:||<{{{10}}}>}}{{#if:||<{{{11}}}>}}{{#if:||<{{{12}}}>}}{{#if:||<{{{13}}}>}}{{#if:||<{{{14}}}>}}{{#if:||<{{{15}}}>}}{{#if:||<{{{16}}}>}}{{#if:||<{{{17}}}>}}{{#if:||<{{{18}}}>}}{{#if:||<{{{19}}}>}}{{#if:||<{{{20}}}>}}{{#if:||<{{{21}}}>}}}} — {{{{#if:|{{{prefix}}}:}}cost{{#if:||<{{{2}}}>}}{{#if:||<{{{3}}}>}}{{#if:||<{{{4}}}>}}{{#if:||<{{{5}}}>}}{{#if:||<{{{6}}}>}}{{#if:||<{{{7}}}>}}{{#if:||<{{{8}}}>}}{{#if:||<{{{9}}}>}}{{#if:||<{{{10}}}>}}{{#if:||<{{{11}}}>}}{{#if:||<{{{12}}}>}}{{#if:||<{{{13}}}>}}{{#if:||<{{{14}}}>}}{{#if:||<{{{15}}}>}}{{#if:||<{{{16}}}>}}{{#if:||<{{{17}}}>}}{{#if:||<{{{18}}}>}}{{#if:||<{{{19}}}>}}{{#if:||<{{{20}}}>}}{{#if:||<{{{21}}}>}}}}-like syntax to display the copper value of the currency