calculate
Evaluate arithmetic into an @ or @@ slot
Evaluate an expression and write the result into a slot. Does not overwrite $ENV.
Syntax
When I calculate "@slot" as "<expression>"Operators: + - * / % ^ and ( ). Standard precedence (2+3*4 → 14); ^ is right-associative (-2^2 → -4).
Qualifiers
| Qualifier | Role | Example |
|---|---|---|
as | Expression string | calculate "@line" as "50*3" |
Examples
When I calculate "@line" as "50*3"
When I calculate "@area" as "2^3"
When I calculate "@tax" as "$TAX_RATE*2"
When I fill "Amount" with "@line"Notes
- Inside the expression,
@/@@/$tokens are scanned left-to-right. - Substituted display values go through number-only parse. Result is a plain decimal (no currency/commas).
- In calculate expressions,
*and^are arithmetic — not label globs.
Related
- Slots and dynamic values
- store
- generate
- should — numeric compares