diff --git a/src/app/(app)/growth/page.tsx b/src/app/(app)/growth/page.tsx index df03f9d..982b58b 100644 --- a/src/app/(app)/growth/page.tsx +++ b/src/app/(app)/growth/page.tsx @@ -104,9 +104,10 @@ function buildSimpleChartData(logs: GrowthLog[], baby: BabyShape, field: "height const inputCls = "w-full px-3 py-2.5 rounded-lg border border-slate-200 dark:border-slate-700 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-400 bg-white dark:bg-slate-800 text-slate-900 dark:text-slate-100"; function fmtAgeWeeks(weeks: number): string { - if (weeks === 0) return "Naiss."; - if (weeks < 4) return `${weeks}sem`; - const months = Math.round(weeks / 4.345); + const w = Math.round(weeks * 10) / 10; + if (w === 0) return "Naiss."; + if (w < 4) return `${w}sem`; + const months = Math.round(w / 4.345); if (months >= 12) return "1 an"; return `${months}m`; }