Template:Price: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Template support for honour specific values)
(Simply, striking backwards compat)
Line 1: Line 1:
<includeonly><!--
<includeonly><span>{{SmallIcon|Gold Icon.png}} Price: {{{1|}}} gp {{#if:{{{2|}}}|/ {{{2}}} gp{{honour}}}}</span></includeonly><noinclude>
To maintain compatibility with existing templates, the honour mode specific value can be
either specified as the second argument or in the first argument separated by :
-->{{#lvardef:base|{{ #explode: {{{1}}}|:|0}}}}<!--
Split parameter into base price and honour price on the :
-->{{#lvardef:honour|{{ #explode: {{{1}}}|:|1}}}}<!--
-->{{#if: {{{2|{{#lvar: honour}}}}}
  | {{SmallIcon|Gold Icon.png}} Price: {{trim | {{#lvar: base}} }}{{nbts}}gp / {{trim | {{{2|{{#lvar: honour}}}}} }}{{nbts}}gp{{honour}}
  | {{SmallIcon|Gold Icon.png}} Price: {{trim | {{#lvar: base}} }}{{nbts}}gp
}}</includeonly><noinclude> <!-- #8239 is non-breaking thin space -->
Usage: {{code|<nowiki>{{Price|20}}</nowiki>}}
Usage: {{code|<nowiki>{{Price|20}}</nowiki>}}


Result: {{Price|20}}
Result: {{Price|20}}
Usage: {{code|<nowiki>{{Price|20:40}}</nowiki>}}
Result: {{Price|20:40}}


Usage: {{code|<nowiki>{{Price|20|40}}</nowiki>}}
Usage: {{code|<nowiki>{{Price|20|40}}</nowiki>}}

Revision as of 12:44, 4 December 2023

Usage: {{Price|20}}

Result: Price: 20 gp

Usage: {{Price|20|40}}

Result: Price: 20 gp / 40 gpHHonour