accounting

package
v1.25.1-0...-2fdc35d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

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

func (d *Decimal) Marshal(b ...[]byte) ([]byte, error)

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

func (d *Decimal) MarshalJSON() ([]byte, error)

MarshalJSON encodes Decimal to protobuf JSON format.

func (*Decimal) Precision

func (d *Decimal) Precision() uint32

Precision returns precision of the decimal number.

func (*Decimal) SetPrecision

func (d *Decimal) SetPrecision(p uint32)

SetPrecision sets precision of the decimal number.

func (*Decimal) SetValue

func (d *Decimal) SetValue(v int64)

SetValue sets value of the decimal number.

func (*Decimal) Unmarshal

func (d *Decimal) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of Decimal.

func (*Decimal) UnmarshalJSON

func (d *Decimal) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Decimal from protobuf JSON format.

func (*Decimal) Value

func (d *Decimal) Value() int64

Value returns value of the decimal number.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL