mirror of
https://github.com/shopspring/decimal.git
synced 2024-10-06 08:45:55 +02:00
36 lines
781 B
Go
36 lines
781 B
Go
|
package decimal
|
||
|
|
||
|
// Code generated by github.com/tinylib/msgp DO NOT EDIT.
|
||
|
|
||
|
import (
|
||
|
"github.com/tinylib/msgp/msgp"
|
||
|
)
|
||
|
|
||
|
// MarshalMsg implements msgp.Marshaler
|
||
|
func (z Decimal) MarshalMsg(b []byte) (o []byte, err error) {
|
||
|
o = msgp.Require(b, z.Msgsize())
|
||
|
o = msgp.AppendFloat64(o, z.InexactFloat64())
|
||
|
return
|
||
|
}
|
||
|
|
||
|
// UnmarshalMsg implements msgp.Unmarshaler
|
||
|
func (z *Decimal) UnmarshalMsg(bts []byte) (o []byte, err error) {
|
||
|
{
|
||
|
var zb0001 float64
|
||
|
zb0001, bts, err = msgp.ReadFloat64Bytes(bts)
|
||
|
if err != nil {
|
||
|
err = msgp.WrapError(err)
|
||
|
return
|
||
|
}
|
||
|
(*z) = NewFromFloat(zb0001)
|
||
|
}
|
||
|
o = bts
|
||
|
return
|
||
|
}
|
||
|
|
||
|
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
|
||
|
func (z Decimal) Msgsize() (s int) {
|
||
|
s = msgp.Float64Size
|
||
|
return
|
||
|
}
|