- Before this lesson
- Working with text
- You will learn to
- Use Math with numbers or variable names
- Keep a counter or running total
- Avoid common number pitfalls
- Sample files
- variables-and-text.station.json
The Math activity
Math takes an Operation, Operand 1, Operand 2 and a Save To Variable.
- Operations: add, subtract, multiply, divide, modulo (remainder), power, round, floor, ceil, abs. The last four need only Operand 1.
- An operand can be a number (
1,3.5) or the name of a variable (units, without braces).
A counter
- Set Variable
count=0before the repetition. - Inside the repetition: Math, add, Operand 1
count, Operand 21, Save To Variablecount.
The same pattern keeps a running total: add the current value to total each time.
Pitfalls
- Decimal point. Use a dot:
3.5, not3,5. Values read from regional spreadsheets may need String Operation replace first. - Text that only looks like a number, such as
12 pcs, makes Math fail with must be a finite number. Clean it first. - Division by zero fails with a clear message. Check with an If Condition when the divisor can be zero.
- Results are written without trailing zeros:
42, not42.00. Format for people at the end, not in the middle.
Activities in this lesson
Math · Set Variable · Log
Saved only in this browser.
Workflow engine-tested. The sample workflow was executed with the macOS Station engine (StationCore) without the user interface. UI steps are source-verified. Written against RPAi Station for macOS 0.1.0 (1) (RPAi_Station_2.0 @ port/macos 9864e96) and the Windows source (RPAi_Station_2.0 @ codex/native-station e68f16d). Reviewed 2026-11-30. UI labels may differ slightly in other versions; see versions and changes.