Skip to content

Commit e84b222

Browse files
vmathur12Vikas Mathur
andauthored
Fix for SQL_DECIMAL type uses comma as separator (#219)
Co-authored-by: Vikas Mathur <[email protected]>
1 parent d07ed07 commit e84b222

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

column.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"reflect"
1212
"time"
1313
"unsafe"
14+
"bytes"
1415

1516
"github.com/ibmdb/go_ibm_db/api"
1617
)
@@ -168,6 +169,9 @@ func (c *BaseColumn) Value(buf []byte) (driver.Value, error) {
168169
case api.SQL_C_DOUBLE:
169170
return *((*float64)(p)), nil
170171
case api.SQL_C_CHAR:
172+
if c.SType == api.SQL_DECIMAL {
173+
return bytes.Replace(buf, []byte(","), []byte("."), 1), nil
174+
}
171175
return buf, nil
172176
case api.SQL_C_WCHAR:
173177
if p == nil {

0 commit comments

Comments
 (0)