Fix floating point display in audit history and estimated remaining
Build and push image / build (push) Successful in 56s
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:
@@ -67,12 +67,6 @@ export function ProductDetail({
|
||||
: []),
|
||||
["Purchase date", fmt.date(item.purchaseDate, getStoredTimezone())],
|
||||
["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 ?? "—"}`],
|
||||
[
|
||||
"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.
|
||||
</div>
|
||||
)}
|
||||
@@ -393,10 +387,10 @@ export function ProductDetail({
|
||||
</div>
|
||||
<div className="mono" style={{ fontSize: 13, textAlign: "right" }}>
|
||||
<div>
|
||||
{a.value} {cfg?.unit}
|
||||
{item.kind === "discrete" ? a.value : a.value.toFixed(2)} {cfg?.unit}
|
||||
</div>
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user