• I'm fromĀ Xenoblade Wiki.

    How can an infobox to multiply a parameter by a constant in the simplest way possible?

    The sell price of an item never changes, and the buy price is 2x, 1.8x, 1.6x, 1.4x, 1.2x, or 1x the sell price, depending on the region's Development Level. However, it seems unnecessary to include every price as a parameter to the infobox when it could be calculated from a single number, the sell price. I'd just like to know how to make a template perform multiplication, so then I can put it multiple times.

    TL;DR: How to multiply?

      Loading editor
    • You define a variable and give it a value, like this:


      That "hides" the variable from showing on the page like <includeonly> would; if you want to define a variable and have it print at the same time, use {{#vardefineecho:}}.

      You can then take that variable and perform calculations with it:

      {{#expr: {{#var:itemcost}} * 2}}
      {{#expr: {{#var:itemcost}} * 1.8}}


        Loading editor
    • there is no #vardefine on target wiki. so it will be
      {{#expr: {{{itemcost}}} * {{{region}}}}}
      there is no usage examples provided, so it is hard to write full line.
        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message