Programming Languages
Bug Report
JavaScript invoice totals off by one cent: floating point money rounding
Our PDF invoices and the amounts charged through Stripe disagreed by a cent on 214 invoices in one month. Floats, toFixed and rounding at every step were to blame. We moved to integer minor units with one explicit rounding point.