Template:GEP/Sandbox/doc: Difference between revisions
< Template:GEP | Sandbox
Content added Content deleted
(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...") |
(Replaced content with "{{No documentation}}") Tag: Replaced |
||
Line 1: | Line 1: | ||
{{documentation}} |
{{No 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>{{,| {{GEPrice|Blue partyhat}}}}</nowiki></code> in a calculation. |
|||
==Usage== |
|||
<pre> |
|||
{{GEP|Blue partyhat}} |
|||
</pre> |
|||
will display as: |
|||
{{GEP|Blue partyhat}} |
|||
<pre> |
|||
{{GEP|Blue partyhat|5}} |
|||
</pre> |
|||
will show the price of 5 Blue partyhats: {{GEP|Blue partyhat|5}}. |
|||
To round the output to a specified number of decimal places, use the <code>round</code> parameter: |
|||
<pre> |
|||
{{GEP|Blue partyhat|1.33|round=2}} |
|||
</pre> |
|||
will display as: |
|||
{{GEP|Blue partyhat|1.33|round=2}} |
|||
===Default=== |
|||
If you specify an item name that does not exist on the Grand Exchange, a script error is thrown. You can set the <code>dflt</code> to a value that will be returned instead of an error. (NB: if you are looking up prices for a [[:Category:Historical Grand Exchange|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. |
|||
<pre> |
|||
{{GEP|Rainbow partyhat|dflt=error}} |
|||
{{GEP|Rainbow partyhat|dflt=0}} |
|||
</pre> |
|||
{{GEP|Rainbow partyhat|dflt=error}} |
|||
{{GEP|Rainbow partyhat|dflt=0}} |
|||
==See also== |
|||
*[[Template:Coins]] |
|||
*[[Template:GEItem]] |
|||
*[[Template:GEPrice]] (same as Template:GEP but with the commas) |
|||
*[[Template:GEInfo]] |
|||
<includeonly>[[Category:Grand Exchange templates|{{PAGENAME}}]]</includeonly> |
Latest revision as of 00:29, 17 October 2024
This template does not have any documentation. Please consider adding documentation at Template:GEP/Sandbox/doc. [edit]
Template:GEP/Sandbox invokes function price in Module:Exchange/Sandbox using Lua.