Template:GEPrice

This is the current revision of this page, as edited by Alex (talk | contribs) at 02:07, 12 October 2024 (Created page with "<includeonly>{{#invoke:Exchange|price}}</includeonly><noinclude>{{/doc}}</noinclude>"). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Template documentation
This documentation is transcluded from Template:GEPrice/doc. [edit] [history] [purge]
Template:GEPrice invokes function price in Module:Exchange using Lua.
Template:GEPrice invokes Module:Exchange using Lua.

This template displays the prices of items with comma formatting, generally for simple templates using tables. For more complicated templates that use a price as part of a calculation, see {{GEP}}.

Warning: This template cannot be used when programming calculators, as the values contain commas by default. Instead, one must use {{GEP}}. See also {{,}}, which performs an identical function to {{GEP}}, though the latter remains the preferred option.

Usage

{{GEPrice|Blue partyhat}} -> 55,000,000

To lookup multiples of the output price:

{{GEPrice|Blue partyhat|2}} -> 110,000,000

Sometimes, the multiple used can be a fraction or float number, e.g. 1.33, which often produces long decimals. To make this more friendly to readers, the round can be used:

{{GEPrice|Blue partyhat|1/3|round=3}} -> 18,333,333.333

Default

If you specify an item name that does not exist on the Grand Exchange, a script error is thrown. You can set the dflt to a value that will be returned instead of an error. (NB: if you are looking up prices for a historical GE item, this will return the default before checking if the item is historical.) You could set this to a string to detect the error, or to a number like 0 to allow calculations to continue, ignoring the non-GE item.

{{GEPrice|Rainbow partyhat|dflt=error}}

{{GEPrice|Rainbow partyhat|dflt=0}}

75,000,000

75,000,000

See also