From ffc05ca5263ab8162d07f7e392cf3960a8f4fbbb Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 8 May 2026 01:12:33 -0400 Subject: [PATCH] Fix floating point display in audit history and estimated remaining MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Round bulk audit values to 2 decimal places in the audit history list and the linear-decay subtitle. Remove container weight / tare from the detail rows — the info is internal to the audit flow and showing the stale initial value after audits is confusing. Co-Authored-By: Claude Opus 4.6 --- web/src/components/ProductDetail.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/web/src/components/ProductDetail.tsx b/web/src/components/ProductDetail.tsx index d365c0c..a9a48ab 100644 --- a/web/src/components/ProductDetail.tsx +++ b/web/src/components/ProductDetail.tsx @@ -67,12 +67,6 @@ export function ProductDetail({ : []), ["Purchase date", fmt.date(item.purchaseDate, getStoredTimezone())], ["Bin", isCheckedOut ? "In your custody" : bin ? bin.name : ], - ...(item.containerWeight != null - ? [ - ["Container weight", `${item.containerWeight.toFixed(2)}g`] as [string, React.ReactNode], - ["Tare (empty jar)", `${(item.containerWeight - item.weight).toFixed(2)}g`] as [string, React.ReactNode], - ] - : []), ["Audit cadence", `Every ${cfg?.cadenceDays ?? "—"} days · ${cfg?.auditMode ?? "—"}`], [ "Cost per gram", @@ -296,7 +290,7 @@ export function ProductDetail({ fontStyle: "italic", }} > - Estimated by linear decay since last {last.mode} on {fmt.dateShort(last.date, getStoredTimezone())} ({last.value} + Estimated by linear decay since last {last.mode} on {fmt.dateShort(last.date, getStoredTimezone())} ({last.value.toFixed(2)} {cfg?.unit}). Re-audit to update. )} @@ -393,10 +387,10 @@ export function ProductDetail({
- {a.value} {cfg?.unit} + {item.kind === "discrete" ? a.value : a.value.toFixed(2)} {cfg?.unit}
- was {a.prev} {cfg?.unit} + was {a.prev != null ? (item.kind === "discrete" ? a.prev : a.prev.toFixed(2)) : "—"} {cfg?.unit}