Documentation ¶
Index ¶
- type Decimal
- func (d *Decimal) Marshal(b ...[]byte) ([]byte, error)
- func (d *Decimal) MarshalJSON() ([]byte, error)
- func (d *Decimal) Precision() uint32
- func (d *Decimal) SetPrecision(p uint32)
- func (d *Decimal) SetValue(v int64)
- func (d *Decimal) Unmarshal(data []byte) error
- func (d *Decimal) UnmarshalJSON(data []byte) error
- func (d *Decimal) Value() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decimal ¶
type Decimal accounting.Decimal
Decimal represents v2-compatible decimal number.
func NewDecimal ¶
func NewDecimal() *Decimal
NewDecimal creates, initializes and returns blank Decimal instance.
func NewDecimalFromV2 ¶
func NewDecimalFromV2(d *accounting.Decimal) *Decimal
NewDecimalFromV2 converts v2 Decimal to Decimal.
func (*Decimal) Marshal ¶
Marshal marshals Decimal into a protobuf binary form.
Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.
func (*Decimal) MarshalJSON ¶
MarshalJSON encodes Decimal to protobuf JSON format.
func (*Decimal) SetPrecision ¶
SetPrecision sets precision of the decimal number.
func (*Decimal) UnmarshalJSON ¶
UnmarshalJSON decodes Decimal from protobuf JSON format.
Click to show internal directories.
Click to hide internal directories.