Add float64 for time.Duration fields

This commit is contained in:
Ivan Daniluk 2016-11-06 17:18:43 +01:00
parent 8db43807c3
commit 5514921bcd
1 changed files with 3 additions and 0 deletions

3
var.go
View File

@ -89,6 +89,9 @@ func Format(v VarValue, kind VarKind) string {
}
return fmt.Sprintf("%s", byten.Size(v.(int64)))
case KindDuration:
if _, ok := v.(float64); ok {
return fmt.Sprintf("%s", roundDuration(time.Duration(v.(float64))))
}
if _, ok := v.(int64); !ok {
break
}