From b51fb511ac97868ae6a2ca7d3ff3e46a84aff8aa Mon Sep 17 00:00:00 2001 From: Konstantin Fickel Date: Thu, 2 Apr 2026 17:07:06 +0200 Subject: [PATCH] fix(timesheet): display zero hours as positive instead of negative zero --- src/cli/commands/timesheet.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/commands/timesheet.rs b/src/cli/commands/timesheet.rs index 9fe413f..f116a82 100644 --- a/src/cli/commands/timesheet.rs +++ b/src/cli/commands/timesheet.rs @@ -40,7 +40,7 @@ fn load_all_shards(base_folder: &Path) -> Result, StreamdErr /// Format hours with sign for display. fn format_diff(hours: f64) -> String { if hours >= 0.0 { - format!("+{:.1}h", hours) + format!("+{:.1}h", hours.abs()) } else { format!("{:.1}h", hours) } @@ -48,7 +48,7 @@ fn format_diff(hours: f64) -> String { /// Format hours for display without sign. fn format_hours(hours: f64) -> String { - format!("{:.1}h", hours) + format!("{:.1}h", hours.abs()) } /// Get the weekday abbreviation.