Calculation functions and examples

Use Neartail's order and numeric functions to calculate amounts, quantities, category totals, and summaries.

Use a field's Answer → Calculate setting to calculate its answer. Insert form-field references with the editor's picker so the expression refers to the actual field. A question's visible title alone is not a reliable field reference.

Order functions

ExpressionPurpose
AMOUNT("$")Total the priced items using the specified currency symbol
TOTAL("$")Alias for the order amount function
QUANTITY("$")Total product quantities from the order lines
TOTALIN("Lunch")Total order lines in the named section
QUANTITYIN("Lunch")Total quantities in the named section
SUMMARY("$", true)Produce an order summary across sections
TEXTSUMMARY("$", true)Produce a text summary suitable for a message

Replace the currency symbol and section title with those used in your form. A summary presents information; it does not itself configure payment or send a message.

Numeric functions

ExpressionResult or behavior
SUM(10, 15, 5)30
ROUND(12.345, 2)12.35
MIN(10, 15)10
MAX(10, 15)15
NUM("12")Convert numeric text to a number
IFS(true, 10, 0)Return the value paired with the first true condition, with a fallback

Use form references in place of literal numbers when the result depends on answers. For example, a percentage fee needs the intended base amount multiplied by its rate, with the result rounded appropriately for your currency.

Expression and display syntax

Older add-on examples wrap expressions in ${...} when placing a calculation in a question or description. For example:

${AMOUNT("$", true)}

Use the syntax expected by the field you are editing. Avoid pasting the display wrapper into every formula input without checking Preview.

Check the result

Try an empty order, one item, several quantities, and every threshold in a discount or fee rule. Verify the payment amount field uses the final amount. See totals and calculation troubleshooting.