commit 8b88beae884cce7b78306c46342f5a7334496ed8
parent 860e63b4be2abfeb5766b242a865db88bea32dff
Author: NunoSempere <nuno.semperelh@protonmail.com>
Date: Sun, 30 Jun 2024 13:24:50 -0400
fix bug after adding suffix code
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pretty/pretty.go b/pretty/pretty.go
@@ -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)
}
}