From d83ac3e50254735a058c2e28f49127ab3a263b5d Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 31 Jul 2021 13:25:54 +0200 Subject: [PATCH] Fix: Use proper rounding Signed-off-by: Knut Ahlers --- mod_presence.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod_presence.go b/mod_presence.go index a13ef93..a8a5b7c 100644 --- a/mod_presence.go +++ b/mod_presence.go @@ -96,7 +96,7 @@ func (m modPresence) cronUpdatePresence() { func (m modPresence) durationToHumanReadable(d time.Duration) string { d = time.Duration(math.Abs(float64(d))) if d > time.Hour*24 { - return fmt.Sprintf("%.0f Tagen", math.Ceil(float64(d)/float64(time.Hour*24))) + return fmt.Sprintf("%.0f Tagen", math.Round(float64(d)/float64(time.Hour*24))) } var elements []string