Fix: Use proper rounding

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-07-31 13:25:54 +02:00
parent b8090d9a52
commit d83ac3e502
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -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