Template:GPValue: Difference between revisions

From Melvor Idle
(Created page with "<includeonly>{{#expr: round( {{#invoke:Items|getItemValue|{{{1}}} }} * {{{2|1}}} , {{{round|0}}} )}}</includeonly><noinclude>{{/doc}}</noinclude>")
(No difference)

Revision as of 15:57, 4 April 2024

This template retrieves the value of an item from Module:Items and optionally multiplies it by a specified factor, rounding the result to a specified number of decimal places.

Parameters:

  • 1: (required) The name of the item to retrieve the value for.
  • 2: (optional) The multiplier to apply to the item value. Defaults to 1 if not provided.
  • round: (optional) The number of decimal places to round the result to. Defaults to 0 if not provided.

Example usage:

{{GPValue|Diamond|10|round=2}}

This retrieves the "sellsfor" value of the item "Diamond" from Module:Items, multiplies it by 10, and round the result to `2` decimal places.

Result: Expression error: Unexpected round operator.