mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 14:55:38 -04:00
config: Don't truncate float64
to int
This commit is contained in:
parent
8b31dc79bf
commit
33b7c9db7c
@ -456,11 +456,11 @@ func GetNativeValue(option string, realValue interface{}, value string) (interfa
|
||||
} else if kind == reflect.String {
|
||||
native = value
|
||||
} else if kind == reflect.Float64 {
|
||||
i, err := strconv.Atoi(value)
|
||||
f, err := strconv.ParseFloat(value, 64)
|
||||
if err != nil {
|
||||
return nil, ErrInvalidValue
|
||||
}
|
||||
native = float64(i)
|
||||
native = f
|
||||
} else {
|
||||
return nil, ErrInvalidValue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user