← Back to Week 4

Deposit vs Payment Sign

The user always types a positive amount. The app decides the sign based on the type: deposit → positive, payment → negative. This one choice makes filtering easy later.

Add a transaction
User entered
45.50
Stored as
+45.50
Deposit — amount stays positive.
Ledger entries
Description Vendor Amount as stored
No transactions yet. Add one on the left.
Why negate on the way in? If payments were stored as positive too, every filter that wants deposits vs payments would need an extra flag or type column. Storing the sign on amount means the Ledger Deposits view is just “amount > 0” and Ledger Payments is just “amount < 0”.
Don’t ask the user for negative numbers. The prompt is always “enter a positive amount.” It is the code’s job to flip the sign when it’s a payment. Entering -50 at the prompt should be treated as invalid.

Try adding a few deposits and payments. Notice how nothing in the ledger table knows whether a row is a “deposit” or “payment” — the sign on the amount tells you everything you need.

← CSV ↔ Transaction Mapping Date Range Reports →