fix bug after adding suffix code
This commit is contained in:
parent
860e63b4be
commit
8b88beae88
|
@ -62,7 +62,6 @@ func multiplyOrPassThroughError(a float64, b float64, err error) (float64, error
|
|||
|
||||
func ParseFloat(word string) (float64, error) {
|
||||
// l = len(word) // assuming no UTF stuff
|
||||
|
||||
switch len(word) {
|
||||
case 0:
|
||||
return 0, errors.New("String to be parsed into float must not be the empty string")
|
||||
|
@ -82,7 +81,7 @@ func ParseFloat(word string) (float64, error) {
|
|||
case 'T':
|
||||
return multiplyOrPassThroughError(1_000_000_000_000, f, err)
|
||||
default:
|
||||
return f, err
|
||||
return strconv.ParseFloat(word, 64)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user