Hardcode float64 output precision to .2

This commit is contained in:
Ivan Daniluk 2015-05-02 22:45:33 +03:00
parent 9dba7d8b7e
commit 9b291c4cba
1 changed files with 4 additions and 0 deletions

4
var.go
View File

@ -95,5 +95,9 @@ func Format(v VarValue, kind VarKind) string {
return fmt.Sprintf("%s", time.Duration(v.(int64)))
}
if f, ok := v.(float64); ok {
return fmt.Sprintf("%.2f", f)
}
return fmt.Sprintf("%v", v)
}