Calculation Fields — Build Quote & Order Forms
Form Forge’s Calculation field does math in real time based on other fields in the same form. Build a pricing calculator, a quote estimator, an order form with automatic totals, a loan payment calculator, a BMI calculator, or any other form that needs to compute a value from user input.
How calculation fields work
Reference other fields in formulas
A calculation field has a Formula setting where you write an expression using {field_id} placeholders for other fields. Example:
{quantity} * {unit_price}
When the user fills in the quantity and unit price fields, the calculation field auto-updates to show the total. The calculation runs in real time as the user types, so there’s no “Calculate” button — the result just appears.
Supported operators
+addition-subtraction*multiplication/division%modulo( )parentheses for order of operations
Supported functions
round({value}, decimals)— round to a specific number of decimalsmin({a}, {b})— return the smaller valuemax({a}, {b})— return the larger valueabs({value})— absolute valuesqrt({value})— square rootif({condition}, {if_true}, {if_false})— conditional expressions
Conditional logic in formulas
Use the if function to change the formula based on other fields:
if({membership} == 'premium', {total} * 0.8, {total})
This gives a 20% discount to members, full price to everyone else.
Real-world examples
Pricing calculator
A service website lets users get a quote based on project size, urgency, and features:
- Project size (radio: Small $500, Medium $1500, Large $5000)
- Urgency (radio: Normal 1x, Urgent 1.5x, Emergency 2x)
- Extra features (checkbox: each adds $200)
- Total (calculation:
{size} * {urgency_multiplier} + ({extras_count} * 200))
The total updates live as the user clicks options.
Loan payment calculator
- Loan amount (number field)
- Interest rate (number field, percentage)
- Loan term (number field, years)
- Monthly payment (calculation field with an amortization formula)
BMI calculator
- Weight (number field, kg)
- Height (number field, cm)
- BMI (calculation:
round({weight} / (({height}/100) * ({height}/100)), 1))
Order form with automatic totals
- Product A quantity (number)
- Product B quantity (number)
- Product C quantity (number)
- Subtotal (calculation:
{a_qty} * 10 + {b_qty} * 25 + {c_qty} * 50) - Tax (calculation:
{subtotal} * 0.1) - Total (calculation:
{subtotal} + {tax})
Combined with Form Forge’s Stripe payment field, the total flows directly into the payment.
Event registration with dynamic pricing
- Number of tickets (number field)
- Ticket type (radio: General $50, VIP $120)
- Early bird discount (checkbox: yes/no, takes 10% off)
- Total (calculation:
if({early_bird}, ({tickets} * {price}) * 0.9, {tickets} * {price}))
Display options
Currency prefix and suffix
Every calculation field supports a prefix (e.g., $, €, £) and a suffix (e.g., USD, /month). The prefix and suffix are display-only; the raw value passed to Stripe or stored in submissions is the number.
Decimal precision
Control how many decimal places the result shows. Useful for currency (2 decimals) vs percentages (1 decimal) vs whole-number counters.
Number formatting
Automatic thousand separators based on locale — 1,234.56 for English, 1.234,56 for German, etc.
Hidden calculations
A calculation field can be hidden from the user and still compute a value. Useful when you need to pass a calculated total to a Stripe payment field but don’t want to clutter the form with “Subtotal” and “Tax” rows.
Connection to Stripe payments
Calculation fields and Stripe payments work together naturally. Point the Stripe payment field’s amount at a calculation field’s ID, and the user’s charge is whatever the calculation produced. Change the formula or the input fields, and the charge updates without any extra configuration.
Real-time updates
Calculations update instantly as the user types or makes selections. No “Calculate” button. No page refresh. The form feels alive.
The client-side formula evaluator is deterministic and handles edge cases (empty fields, zero values, division by zero) gracefully — the field shows a placeholder until the required inputs are filled in.
Ready to build a calculator form?
The calculation field is included in every paid plan.