K
Docs
🔢

Math

base.mathBase SetUtility

Runs an arithmetic expression and stores the answer as a Spark. Add scores, calculate percentages, multiply rewards — if numbers are involved, this piece does the work.

When to use this
  • Supports +, -, *, /, and parentheses: ({{a}} + {{b}}) * 2
  • Tip: for simple +1/-1, use Write to Vault's built-in + Add / − Sub mode instead

On the canvas

This is what Math looks like when you place it on your flow. Each field below is something you configure in the inspector panel.

🔢
Math
base.math
Utility
expressionrequired
{{result.0.coins}} + 10
asrequired
newScore (becomes a Spark!)

Config fields

FieldTypeReqWhat it does
expression
{{result.0.coins}} + 10
textyesThe calculation 🧮
as
newScore (becomes a Spark!)
textyesName the result ✨

Sparks this piece adds

After this piece runs, these values are available as sparks in every node downstream.

{{total}}numberMath calculation result

Output ports

outputMoves on with the calculation result as a Spark
📐

In TypeScript, this would be…

Not something you need to write — just a look at what Kitcord does for you.

TypeScript
const newCoins = Number(result[0].coins) + 10;
// Expression: {{result.0.coins}} + 10 → {{newCoins}}