Template:GEPrice

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search
Template documentation
This documentation is transcluded from Template:GEPrice/doc. [edit] [purge]
Template:GEPrice invokes function price in 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

Basic usage

{{GEPrice|Blue partyhat}} -> 2,147,483,647

Multiplier

To lookup multiples of the output price:

{{GEPrice|Blue partyhat|2}} -> 4,294,967,294

Rounding

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}} -> 715,827,882.333

Default

If you specify an incorrect item name, 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}}

error

0

See also

Template data

Show/hide template's data

The following information is used by extensions and applications, such as VisualEditor, to help users implement this template onto pages. Please ensure that it is up-to-date.

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 {{T|GEP}}. This template cannot be used when programming calculators, as the values contain commas by default. Instead, one must use {{T|GEP}}.

Template parameters

This template has custom formatting.

ParameterDescriptionTypeStatus
Item name1

The name of the item to be priced

Default
empty
Example
Blue partyhat
Auto value
empty
Stringrequired
Number2

The number of item

Default
empty
Example
5
Auto value
empty
Numberoptional
Roundinground

Number of decimal places to round to

Default
empty
Example
2
Auto value
empty
Numberoptional
Defaultdflt

A value (string, number, or otherwise) that is returned if the looked-up item doesn't exist, rather than throwing a script error.

Default
empty
Example
0
Auto value
empty
Unknownoptional