From 4c281a1606b76c2d183c7bdadf0649ceb2cc5159 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Sun, 26 Apr 2026 00:15:48 +0000 Subject: [PATCH] fix: preserve fractional weights in PR/Recent markdown display Use formatWeight() instead of %.0f so values like 152.5 are shown correctly instead of being truncated to 152. Fixes #27 Co-authored-by: Darrell --- cmd/stats.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/stats.go b/cmd/stats.go index 699a950..cfed562 100644 --- a/cmd/stats.go +++ b/cmd/stats.go @@ -220,8 +220,8 @@ func printWeightSummary(sessions []SessionStats) { recent := sessions[len(sessions)-1] prDate, _ := time.Parse("2006-01-02", pr.Date) - fmt.Printf(" PR: %.0fx%d (%s)\n", pr.BestWeight, pr.BestReps, prDate.Format("Jan 2006")) - fmt.Printf(" Recent: %.0fx%d\n", recent.BestWeight, recent.BestReps) + fmt.Printf(" PR: %sx%d (%s)\n", formatWeight(pr.BestWeight), pr.BestReps, prDate.Format("Jan 2006")) + fmt.Printf(" Recent: %sx%d\n", formatWeight(recent.BestWeight), recent.BestReps) } func printDurationSummary(sessions []SessionStats) { @@ -335,7 +335,7 @@ func printSummariesTextDetail(summaries []ExerciseSummary) { for _, ss := range ex.Sessions { fmt.Printf(" %s BW=%.0f %d sets %d reps", ss.Date, ss.Bodyweight, ss.Sets, ss.Reps) if ss.BestWeight > 0 { - fmt.Printf(" %.0fx%d", ss.BestWeight, ss.BestReps) + fmt.Printf(" %sx%d", formatWeight(ss.BestWeight), ss.BestReps) } if ss.Volume > 0 { fmt.Printf(" vol=%.0f", ss.Volume)