Template:GEP/Sandbox/doc

This is an old revision of this page, as edited by Alex (talk | contribs) at 00:29, 17 October 2024 (Created page with "{{documentation}} {{invokes|Exchange}} {{t|GEP}} displays values entered into the Grand Exchange Market Watch mw.pages that can be used to help perform calculations and display prices where the full table might be inappropriate. This template is useful primarily in calculations because it avoids calculation errors caused by commas in the prices. It is much simpler to use <code><nowiki>{{GEP|Blue partyhat}}</nowiki></code> rather than to use <code><nowiki>{{,| {{GEP..."). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is a documentation subpage for Template:GEP/Sandbox.
It contains usage information, categories, and other content that is not part of the original template page.
Template:GEP/Sandbox invokes function price in Module:Exchange/Sandbox using Lua.
Template:GEP/Sandbox invokes Module:Exchange using Lua.

{{GEP}} displays values entered into the Grand Exchange Market Watch mw.pages that can be used to help perform calculations and display prices where the full table might be inappropriate.

This template is useful primarily in calculations because it avoids calculation errors caused by commas in the prices. It is much simpler to use {{GEP|Blue partyhat}} rather than to use {{,| {{GEPrice|Blue partyhat}}}} in a calculation.


Usage

{{GEP|Blue partyhat}}

will display as:

55000000

{{GEP|Blue partyhat|5}}

will show the price of 5 Blue partyhats: 275000000.

To round the output to a specified number of decimal places, use the round parameter:

{{GEP|Blue partyhat|1.33|round=2}}

will display as:

73150000

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.

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

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

75000000

75000000

See also