Penny-exact allocation
Split 100.00 three ways and get 33.34 / 33.33 / 33.33 — never a cent left in suspense.
- Runs
- In this tab
- Data sent
- None
- Rounding
- Once, at the end
- Also in
- The Chrome extension
Penny-exact allocation, worked
Showing a worked example — type over it
Result
How the penny-exact allocation works.
Allocation (largest-remainder, sums to the total exactly)
Quoted from the toolbelt spec, the document this tool was built against.
Where these numbers come from.
Negatives are parenthesised because that is what a statement does. The rest is four promises.
Minor units, never floats
Amounts are integers in the currency's smallest unit, end to end. A float never touches a cent.
Rounded once
Rounded once, at the end — never per operand, which is how a split stops summing to the whole.
Unit tested
The arithmetic lives in one unit-tested module, shared without reimplementation with the extension.
No network
There is no request to make. What you type stays in this tab and is gone when you close it.
More in money maths
- VAT / sales taxGross to net is a division, not a multiplication. The three figures always add back up.
- Margin & markupThey are not the same number, and confusing them is how a price list quietly loses money.
- FX conversion & gain/lossThe rate is the one in your policy, so you type it. No live rate, no network call, no stale surprise.
- NPV, IRR & XIRRIRR by bisection, so a sign-change-heavy series does not converge on a confident wrong answer.
- Effective vs nominal rate12% compounded monthly is 12.68%. That difference is the covenant you either pass or fail.
The same number, elsewhere.
A calculator answers the question once. These carry the answer into a product, name what it computed, and argue the method.
- ComponentMoneyThe core primitive. A monetary value, formatted correctly.
- ComponentCashApplicationThe highest-value screen in AR. Every case, not just the happy one.
- ComponentPaymentRunBuilderShows the cash balance remaining after the run.
- TermApplicationAssigning received cash to specific invoices
- TermUnapplied cashCustomer cash received but not yet assigned to an invoice. It reduces that customer's AR; only a net credit balance is reclassified to a liability at period end
- DocNumericsThe document that makes this a finance system rather than a dashboard kit. Everything here is a rule the rest of the library enforces on the consumer's behalf.
- EntryJournal entry for a customer depositWhen a customer pays a deposit, debit Cash and credit Customer deposits. On delivery, debit Customer deposits for the deposit, debit Accounts receivable for the balance, and credit Revenue for the full price.
- EntryJournal entry for a bundled contract under ASC 606For a contract with several promises, debit Accounts receivable and credit Deferred revenue for the price when billed, allocate the price to each performance obligation by relative standalone selling price, and credit Revenue for each part as that promise is satisfied.
- EntryJournal entry for issuing common stockWhen shares are issued for cash, debit Cash for the proceeds, credit Common stock for the par value of the shares, and credit Additional paid-in capital for everything above par.
- DocCurrency decimal placesHow many decimals each ISO 4217 code is stored at — JPY 0, USD 2, KWD 3.