Calculate Block
Calculate evaluates arithmetic expressions with variables, numeric helpers, and strict error handling for invalid values.
At a glance
What it does
Calculate turns numbers and variables into a new numeric result.
It supports arithmetic, parentheses, unary signs, paths, currency/percent parsing helpers, and common math helpers.
Use it when
- Calculate prices, totals, rates, or scores.
- Normalize scraped currency or percent text before comparing.
- Clamp, round, or combine numeric variables.
Do not use it when
- The output should be text formatting; use Format.
- The input can be nonnumeric and should not fail.
- You need a branch based on a comparison; combine Calculate with Conditional.
Settings
Calculate requires an expression and an output variable. Variables use normal {{variableName}} syntax.
Expression
Required: Yes- Variables
- Yes
- Description
- Numeric expression using operators, variables, paths, and helper functions.
Output variable
Required: Yes- Variables
- Variable name
- Description
- Variable that receives the numeric result.
Outputs
Calculate writes a number variable.
{{outputVariableName}}numberThe evaluated numeric result.
Example Flow
Use Calculate after extracting or formatting numeric values.
- Extract or define numeric inputs.
- Calculate the derived value.
- Use the result in Conditional, Template, or export Blocks.
Errors and fixes
Start with symptoms visible in the editor or Inspector, then check the earliest Block that produced the wrong page state, variable, or output.
The Block fails on a value.
- Check
- Check whether every variable resolves to a numeric value.
- Fix
- Use Format or Type Conversion before Calculate when input is messy text.
The expression is invalid.
- Check
- Check parentheses, operator placement, and function arguments.
- Fix
- Simplify the expression and add variables one at a time.
Local and cloud runs
Calculate has a shared parity corpus for local, cloud, and export behavior. Changes to expression syntax should keep all runtimes in sync.