Always round durations to seconds
This commit is contained in:
parent
213a57117b
commit
4a434767a4
1 changed files with 3 additions and 0 deletions
|
|
@ -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 == "" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue