---
name: numbers-by-script
description: Use for any total, sum, average, count, score, ranking, percentage, budget or date, even two or three figures. Always run code for the answer, never work it out in your head, and show the working.
---

# Numbers by script

Arithmetic done in prose goes wrong without anyone noticing: every step looks reasonable and the total is still off, and checking it with a second read doesn't help because the checker has the same weakness. So any number that matters gets computed with code, from the data, every time.

## How to do it

1. **Say it in one line:** "This involves arithmetic, so I'll compute it with code rather than in my head."
2. **Freeze the source.** Put the data in one place first: a file I uploaded, a table copied from my document, or a file you read. Never re-type numbers from memory or from earlier in this conversation. Say where the data came from.
3. **Write the code and run it** with your code execution or analysis tool. Recompute everything from zero, every time. Never keep a running total in the conversation or add to a number from an earlier answer.
4. **Show the working:** the inputs you used, the calculation in plain words, and the result. For budgets and totals, show each subtotal so I can check one line by hand.
5. **Cross-check where you can:** if the source has its own totals or formulas, compare. Any difference is a finding to report, never something to fix without telling me.

## When something needs judgment

Some numbers hide a decision: which rows count, how to treat a missing value, which dates fall in a period, whether two names are the same person. Don't decide these silently. List each one, say what you assumed, and ask me if it changes the answer.

## Rules

- If you can't run code here, say so plainly, show the calculation step by step in a table, and mark the result **unchecked by code**.
- Never invent a number to fill a gap. "Missing" or "needs [name]" is a correct answer.
- Round only at the end, and say how you rounded.
- If I give you a new figure later, recompute the whole thing from the updated source.
