From ab95f49c96331aea87865fd3dfa86beb9fa8a397 Mon Sep 17 00:00:00 2001 From: nxshock Date: Fri, 9 Feb 2024 09:45:27 +0500 Subject: [PATCH] Implement money type as numeric field --- fieldtypes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fieldtypes.go b/fieldtypes.go index c816c25..9822a73 100644 --- a/fieldtypes.go +++ b/fieldtypes.go @@ -41,7 +41,7 @@ func (ft FieldType) ParseValue(reader Reader, s string) (any, error) { return s, nil case Integer: return strconv.ParseInt(s, 10, 64) - case Float: + case Float, Money: return strconv.ParseFloat(strings.ReplaceAll(s, ",", "."), 64) case Date: if i, ok := reader.(CustomDateParser); ok { @@ -77,7 +77,7 @@ func (ft FieldType) SqlFieldType() string { case Float: return "float" case Money: - panic("do not implemented - see https://github.com/denisenkom/go-mssqldb/issues/460") // TODO: https://github.com/denisenkom/go-mssqldb/issues/460 + return "numeric(15, 2)" // TODO: https://github.com/denisenkom/go-mssqldb/issues/460 case Date: return "date" case Timestamp: