Fix floating point display in audit history and estimated remaining
Build and push image / build (push) Successful in 56s

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 <noreply@anthropic.com>
This commit is contained in:
2026-05-08 01:12:33 -04:00
parent a1be29ab6e
commit ffc05ca526
+3 -9
View File
@@ -67,12 +67,6 @@ export function ProductDetail({
: []), : []),
["Purchase date", fmt.date(item.purchaseDate, getStoredTimezone())], ["Purchase date", fmt.date(item.purchaseDate, getStoredTimezone())],
["Bin", isCheckedOut ? "In your custody" : bin ? bin.name : <span style={{ color: "var(--ink-3)" }}></span>], ["Bin", isCheckedOut ? "In your custody" : bin ? bin.name : <span style={{ color: "var(--ink-3)" }}></span>],
...(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 ?? "—"}`], ["Audit cadence", `Every ${cfg?.cadenceDays ?? "—"} days · ${cfg?.auditMode ?? "—"}`],
[ [
"Cost per gram", "Cost per gram",
@@ -296,7 +290,7 @@ export function ProductDetail({
fontStyle: "italic", 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. {cfg?.unit}). Re-audit to update.
</div> </div>
)} )}
@@ -393,10 +387,10 @@ export function ProductDetail({
</div> </div>
<div className="mono" style={{ fontSize: 13, textAlign: "right" }}> <div className="mono" style={{ fontSize: 13, textAlign: "right" }}>
<div> <div>
{a.value} {cfg?.unit} {item.kind === "discrete" ? a.value : a.value.toFixed(2)} {cfg?.unit}
</div> </div>
<div style={{ fontSize: 10, color: "var(--ink-3)" }}> <div style={{ fontSize: 10, color: "var(--ink-3)" }}>
was {a.prev} {cfg?.unit} was {a.prev != null ? (item.kind === "discrete" ? a.prev : a.prev.toFixed(2)) : "—"} {cfg?.unit}
</div> </div>
</div> </div>
</div> </div>