Template:GEPT/doc: Difference between revisions

From RuneRealm Wiki
Jump to navigation Jump to search
Content added Content deleted
No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
 
Line 2: Line 2:
{{invokes|Exchange}}
{{invokes|Exchange}}


{{t|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.
{{t|GEPT}} displays values entered into the [[Grand Exchange Market Watch]] 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 {{GETax}}, especially on high quantities of low-cost items. For example, cleaning 1000 [[Grimy guam leaf]] that are bought at {{Coins|{{GEP|Grimy guam leaf|1000}}}}, cleaned and sold at {{Coins|{{GEPT|Guam leaf|1000}}}} would generate a profit of {{Coins|{{GEPT|Guam leaf|1000}}-{{GEP|Grimy guam leaf|1000}}}}. However, if a naive multiplication by {{GETax}} is used to calculate the profit, it is reduced to {{Coins|{{GEP|Guam leaf|1000}}*{{GETax}}-{{GEP|Grimy guam leaf|1000}}}}.
This template is useful primarily in profit calculations because it avoids calculation errors caused by rounding when simply multiplying by {{GETax}}, especially on high quantities of low-cost items. For example, cleaning 1000 [[Grimy guam leaf]] that are bought at {{Coins|{{GEP|Grimy guam leaf|1000}}}}, cleaned and sold at {{Coins|{{GEPT|Guam leaf|1000}}}} would generate a profit of {{Coins|{{GEPT|Guam leaf|1000}}-{{GEP|Grimy guam leaf|1000}}}}. However, if a naive multiplication by {{GETax}} is used to calculate the profit, it is reduced to {{Coins|{{GEP|Guam leaf|1000}}*{{GETax}}-{{GEP|Grimy guam leaf|1000}}}}.

Latest revision as of 11:41, 17 October 2024

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 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