Remove spaces before parsing float types

This commit is contained in:
nxshock 2024-02-09 09:46:09 +05:00
parent ab95f49c96
commit 81729ffcd0

View File

@ -42,7 +42,9 @@ func (ft FieldType) ParseValue(reader Reader, s string) (any, error) {
case Integer: case Integer:
return strconv.ParseInt(s, 10, 64) return strconv.ParseInt(s, 10, 64)
case Float, Money: 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: case Date:
if i, ok := reader.(CustomDateParser); ok { if i, ok := reader.(CustomDateParser); ok {
t, err := i.ParseDate(s) t, err := i.ParseDate(s)