From 81729ffcd07a971c1eb052850480ce022f69fb70 Mon Sep 17 00:00:00 2001 From: nxshock Date: Fri, 9 Feb 2024 09:46:09 +0500 Subject: [PATCH] Remove spaces before parsing float types --- fieldtypes.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fieldtypes.go b/fieldtypes.go index 9822a73..dbc237d 100644 --- a/fieldtypes.go +++ b/fieldtypes.go @@ -42,7 +42,9 @@ func (ft FieldType) ParseValue(reader Reader, s string) (any, error) { case Integer: return strconv.ParseInt(s, 10, 64) case Float, Money: - return strconv.ParseFloat(strings.ReplaceAll(s, ",", "."), 64) + s = strings.ReplaceAll(s, ",", ".") + s = strings.ReplaceAll(s, " ", "") + return strconv.ParseFloat(s, 64) case Date: if i, ok := reader.(CustomDateParser); ok { t, err := i.ParseDate(s)