Template:GEPT/doc

From RuneRealm Wiki

This is an old revision of this page, as edited by Alex (talk | contribs) at 00:29, 17 October 2024. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Jump to navigation Jump to search
This is a documentation subpage for Template:GEPT.
It contains usage information, categories, and other content that is not part of the original template page.
Template:GEPT invokes function price in Module:Exchange using Lua.
Template:GEPT invokes Module:Exchange using Lua.

{{GEPT}} displays values entered into the Grand Exchange Market Watch mw.pages with GE tax applied to them, that can be used to help perform profit calculations.

This template is useful primarily in profit calculations because it avoids calculation errors caused by rounding when simply multiplying by 0.99, especially on high quantities of low-cost items. For example, cleaning 1000 Grimy guam leaf that are bought at 8,000, cleaned and sold at 14,000 would generate a profit of 6,000. However, if a naive multiplication by 0.99 is used to calculate the profit, it is reduced to 5,860.00.


Usage

{{GEPT|Blue partyhat}}

will display as:

54450000

{{GEPT|Blue partyhat|5}}

will show the taxed price of 5 Blue partyhats: 272250000.

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

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

will display as:

72418500

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.

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

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

74250000

74250000

See also