Skip to content

Commit

Permalink
Fix for SQL_DECIMAL type uses comma as separator (#219)
Browse files Browse the repository at this point in the history
Co-authored-by: Vikas Mathur <[email protected]>
  • Loading branch information
vmathur12 and Vikas Mathur authored Jul 5, 2023
1 parent d07ed07 commit e84b222
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions column.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"reflect"
"time"
"unsafe"
"bytes"

"github.com/ibmdb/go_ibm_db/api"
)
Expand Down Expand Up @@ -168,6 +169,9 @@ func (c *BaseColumn) Value(buf []byte) (driver.Value, error) {
case api.SQL_C_DOUBLE:
return *((*float64)(p)), nil
case api.SQL_C_CHAR:
if c.SType == api.SQL_DECIMAL {
return bytes.Replace(buf, []byte(","), []byte("."), 1), nil
}
return buf, nil
case api.SQL_C_WCHAR:
if p == nil {
Expand Down

0 comments on commit e84b222

Please sign in to comment.