Template:Sell expr/doc

This template can be used to handle elaborate expressions in conjunction with item sell values. The sell values are generated using iteminfo, hence they are dynamic and are adjusted accordingly should they be altered in a future Terraria update.

It aims at simplifying the convoluted syntax that is required for displaying sell value expressions:  can be shortened to   using this template.

For handling buy prices instead of sell values, use buy expr. The syntax and usage is exactly the same.

Usage
Name or ID of an item whose sell value is to be inserted at that part of the expression. Can be empty.
 * 1st, 3rd, 5th, 7th, ..., nth unnamed parameter

Operators, constants, etc. – valid #expr syntax. Can be empty.
 * 2nd, 4th, 6th, 8th, ..., (n+1)-th unnamed parameter

Suppress the coin wrapping and instead display the numerical value, e.g. for use in other expressions.
 * raw

Rounding functionality of coin, see Template:Coin for documentation and examples. Has no effect when using.
 * round

Concept
Example: Multiply the sum of the sell values of 3 Pixie Dust and 1 Crystal Shard by 5 and add the sell value of 7 Souls of Light.

Think of writing the expression normally:

For this template, simply replace the  parts with  :

Now check if the first unnamed parameter is still an item name or ID. If it is not, add an empty parameter to fix that:

Result:

Proof: