From 96c68fb49279bab111886ac8317a307d4339709c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 21 May 2026 10:30:24 +0200 Subject: [PATCH] fix(measurements): preserve decimal precision on non-grouped list rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v1.4.37 W7c collapsed list view passed every value through `fmt.integer`, which kept the per-day step / activity aggregates correct but silently truncated single weight / body-fat / body-temperature readings — 78.4 kg rendered as "78 kg" on the desktop table and the mobile card grid. Grouped rows (`isGrouped === true`, the daily aggregate for cumulative HK types) keep `fmt.integer` because the underlying readings are integer-only by definition. Non-grouped single readings now use `fmt.number(value)` which honours up to three fraction digits without forcing a minimum, so 78 stays "78" and 78.4 renders as "78.4" / "78,4" depending on the active UI locale. --- .../measurements/measurement-list.tsx | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/components/measurements/measurement-list.tsx b/src/components/measurements/measurement-list.tsx index 99824c470..3f4b81715 100644 --- a/src/components/measurements/measurement-list.tsx +++ b/src/components/measurements/measurement-list.tsx @@ -544,7 +544,20 @@ export function MeasurementList({ onEdit, onAddFirst }: MeasurementListProps) { - {fmt.integer(m.value)} {m.unit} + {/* v1.4.39.3 — non-grouped rows render the + stored value with its native precision + (`fmt.number` honours up to 3 fraction + digits by default, drops trailing zeros) + so a 78.4 kg weight reading stops + truncating to "78". Grouped rows are + cumulative-type day aggregates (steps, + distance, etc.) and stay on `fmt.integer` + because the underlying readings are + integer-only by definition. */} + {isGrouped + ? fmt.integer(m.value) + : fmt.number(m.value)}{" "} + {m.unit} {isGrouped && ( {t("measurements.dailyTotalCaption", { @@ -683,7 +696,15 @@ export function MeasurementList({ onEdit, onAddFirst }: MeasurementListProps) { )} - {fmt.integer(m.value)} {m.unit} + {/* v1.4.39.3 — mirror the desktop table: + grouped daily aggregates stay integer, + non-grouped single readings render with + their native decimal precision so + "78.4 kg" no longer truncates to "78". */} + {isGrouped + ? fmt.integer(m.value) + : fmt.number(m.value)}{" "} + {m.unit} {isGrouped && (