fmtMoney: snap |n| < half a cent to exact 0 — kills $-0.00 from float-residue spend

This commit is contained in:
Inferencebot committed 2026-10-19 12:05:51 -06:00
1 parent 9cc636dd99
commit 2dee1ea71d
1 file changed
+1 -1
+1 -1
View File
@@ -599,7 +599,7 @@ function flash(msg, ok) {
setTimeout(() => { f.className = 'flash'; }, 6000); setTimeout(() => { f.className = 'flash'; }, 6000);
} }
function fmtMoney(n) { return '$' + (Number(n) || 0).toFixed(2); } function fmtMoney(n) { const v = Math.abs(Number(n)) < 0.005 ? 0 : (Number(n) || 0); return '$' + v.toFixed(2); }
async function load() { async function load() {
try { try {