From 8e670f4d97327b06563af3a38296e63be10e934f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 25 Oct 2025 14:51:00 -0500 Subject: needed >= --- formatDuration.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/formatDuration.go b/formatDuration.go index f9cd547..dc4ce2d 100644 --- a/formatDuration.go +++ b/formatDuration.go @@ -17,7 +17,6 @@ func FormatDuration(d time.Duration) string { return result } - days := int(d.Hours()) / 24 /* was terrible // check if it's more than a day if days > 45 { @@ -27,21 +26,22 @@ func FormatDuration(d time.Duration) string { } */ - if days > 0 { + days := int(d.Hours()) / 24 + if days >= 2 { result += fmt.Sprintf("%3d d", days) return result } // check if it's more than an hour hours := int(d.Hours()) % 24 - if hours > 2 { + if hours >= 2 { result += fmt.Sprintf("%3d h", hours) return result } // check if it's more than a minute minutes := int(d.Minutes()) % 60 - if minutes > 2 { + if minutes >= 2 { result += fmt.Sprintf("%3d m", minutes) return result } @@ -55,7 +55,7 @@ func FormatDuration(d time.Duration) string { // report in milliseconds ms := int(d.Milliseconds()) - if ms > 100 { + if ms >= 100 { // todo: print .3s, etc ? } if ms > 0 { -- cgit v1.2.3