diff --git a/nreflect/convert.go b/nreflect/convert.go index 8683052..a5e4514 100644 --- a/nreflect/convert.go +++ b/nreflect/convert.go @@ -209,7 +209,9 @@ func ValToString(rv reflect.Value, defaultAsErr bool) (str string, err error) { str = strconv.FormatBool(rv.Bool()) case reflect.String: str = rv.String() - case reflect.Float32, reflect.Float64: + case reflect.Float32: + str = strconv.FormatFloat(rv.Float(), 'f', -1, 32) + case reflect.Float64: str = strconv.FormatFloat(rv.Float(), 'f', -1, 64) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: str = strconv.FormatInt(rv.Int(), 10)