mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-17 22:37:10 +09:00
config: Don't truncate float64 to int
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user