Update decimal.go

This commit is contained in:
Lanre Ade 2019-03-03 16:33:54 -07:00
parent cd690d0c9e
commit a3267013b7

View file

@ -970,6 +970,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) {