Skip to content← All gravesR.I.P.
The 0.1 + 0.2 invoice
–
“Owed ₹0.30000000000000004. Paid in full.”
JavaScriptFloating point
Death certificate
- Status
- 🪦 Buried
- Cause of death
- Floating point0.1 plus 0.2 was never going to be 0.3.
- Severity
- Critical
- Hours to kill
- 9 hours
- Killed by
- Jashanpreet
- Language
- JavaScript
- Born
- 17 Jun 2024
- Fix merged
- 21 Jun 2024
- Buried
- 1 Jul 2024
- Component
- billing
- Symptoms
- Invoice totals came out as 0.30000000000000004 and didn't match the bank's amounts.
- The fix
- Stored money as whole paise and only formatted it for display.
Timeline
Every life of this bug, oldest first.
- 🐛
Born as “The 0.1 + 0.2 invoice”17 Jun 2024
- 🩹
Fix merged21 Jun 2024
- 🪦
Buried1 Jul 2024