-
Database
Stop storing money as floats
Finds every money value stored or calculated as a floating point number and converts it to integer cents or a decimal type.
Free Prompt
What This Does / How This Helps
Replaces every float that touches money with integer cents or a decimal type, in the database and in code. Floats cannot represent most decimal values exactly. 0.1 plus 0.2 is 0.30000000000000004 in JavaScript. That is funny until it is a customer's invoice total that disagrees with Stripe by a cent, a balance that goes negative by 0.0000001, or a comparison that silently fails and lets a discount apply twice. AI assistants generate float columns and plain number math by default because it looks natural. This prompt finds every instance, converts storage and arithmetic to exact representations, and gives you the rounding-error test that proves the fix.
Want to skip doing this by hand?
Fortivibe audits your app for all of the areas these prompts cover (and more).