mirror of
https://github.com/nxshock/mssqlbulkloader.git
synced 2024-11-27 00:11:02 +05:00
Implement money type as numeric field
This commit is contained in:
parent
92f089b828
commit
ab95f49c96
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user