centslisted
Install: claude install-skill lkc-studio/claude-plugins
# Cents: money does not belong in float
`0.1 + 0.2 == 0.30000000000000004`. A binary float cannot represent most
decimal fractions, so every arithmetic step on money loses a sliver. Across a
million transactions the slivers add up, the books do not balance, and the bug
is invisible until an auditor finds it.
The fix is old and boring — use `Decimal`, or store integer minor units (cents)
— so this skill is not about the fix. It is about finding **every** place the
mistake was made, which by hand means reading every arithmetic line in the
codebase and asking "is this money?"
## The trap that makes naive scanning useless
`float` is not wrong. It is wrong *for money*. A ratio, a coordinate, a
temperature, an interest rate, an ML weight all belong in float. A scanner that
flags every float drowns the real bugs in a scientific codebase and gets turned
off within a day.
So the question is never "is this a float". It is:
> **Is this a float that represents money?**
`cents` answers it by pairing two signals: a float, and a money name next to it.
Same shape as the rest of this plugin — the construct is only a bug in context.
## Step 1: scan
```bash
scripts/cents.py billing.py # one file
scripts/cents.py --all src/ # a tree
scripts/cents.py --json payments.py # for pipelines
```
AST-based, standard library only. It reports each place a float meets a money
name, with the line, the name, and the fix.
```
billing.py:6 [arithmetic] (subtotal)
subto