mirror of
https://github.com/shopspring/decimal.git
synced 2024-11-23 04:40:49 +01:00
Compare commits
2 commits
b3818e7f64
...
98b69c0a5f
Author | SHA1 | Date | |
---|---|---|---|
|
98b69c0a5f | ||
|
a3267013b7 |
1 changed files with 5 additions and 0 deletions
|
@ -1523,6 +1523,11 @@ func (d Decimal) MarshalBinary() (data []byte, err error) {
|
||||||
|
|
||||||
// Scan implements the sql.Scanner interface for database deserialization.
|
// Scan implements the sql.Scanner interface for database deserialization.
|
||||||
func (d *Decimal) Scan(value interface{}) error {
|
func (d *Decimal) Scan(value interface{}) error {
|
||||||
|
if value == nil {
|
||||||
|
d = nil
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// first try to see if the data is stored in database as a Numeric datatype
|
// first try to see if the data is stored in database as a Numeric datatype
|
||||||
switch v := value.(type) {
|
switch v := value.(type) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue