Always round durations to seconds

This commit is contained in:
andig 2021-01-31 21:46:46 +01:00
parent 213a57117b
commit 4a434767a4

View file

@ -4,6 +4,7 @@ import (
"fmt"
"regexp"
"strings"
"time"
)
var re = regexp.MustCompile(`\${(\w+)(:([a-zA-Z0-9%.]+))?}`)
@ -32,6 +33,8 @@ func FormatValue(format string, val interface{}) string {
format = format[:len(format)-1]
val = typed / 1e3
}
case time.Duration:
val = typed.Round(time.Second)
}
if format == "" {