Documentation
¶
Index ¶
- Constants
- Variables
- type Decimal
- func (m Decimal) Add(d *Decimal) *Decimal
- func (m *Decimal) Copy() *Decimal
- func (*Decimal) Descriptor() ([]byte, []int)
- func (m Decimal) Equal(v *Decimal) bool
- func (m Decimal) GT(v *Decimal) bool
- func (m Decimal) GTE(v *Decimal) bool
- func (m *Decimal) GetPrecision() uint32
- func (m *Decimal) GetValue() int64
- func (m Decimal) LT(v *Decimal) bool
- func (m Decimal) LTE(v *Decimal) bool
- func (m *Decimal) Marshal() (dAtA []byte, err error)
- func (m *Decimal) MarshalTo(dAtA []byte) (int, error)
- func (m *Decimal) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m Decimal) Neg() *Decimal
- func (m *Decimal) Parse(v float64, p int) *Decimal
- func (*Decimal) ProtoMessage()
- func (m *Decimal) Reset()
- func (m *Decimal) Size() (n int)
- func (m Decimal) String() string
- func (m *Decimal) Unmarshal(dAtA []byte) error
- func (m *Decimal) XXX_DiscardUnknown()
- func (m *Decimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Decimal) XXX_Merge(src proto.Message)
- func (m *Decimal) XXX_Size() int
- func (m *Decimal) XXX_Unmarshal(b []byte) error
- func (m Decimal) Zero() bool
Constants ¶
View Source
const GASPrecision = 8
GASPrecision contains precision for NEO Gas token.
Variables ¶
View Source
var ( ErrInvalidLengthDecimal = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowDecimal = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupDecimal = fmt.Errorf("proto: unexpected end of group") )
View Source
var Zero = &Decimal{}
Zero is empty Decimal value.
Functions ¶
This section is empty.
Types ¶
type Decimal ¶
type Decimal struct { // Value is value number Value int64 `protobuf:"varint,1,opt,name=Value,proto3" json:"Value,omitempty"` // Precision is precision number Precision uint32 `protobuf:"varint,2,opt,name=Precision,proto3" json:"Precision,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Decimal is a structure used for representation of assets amount
func NewWithPrecision ¶
NewWithPrecision returns new Decimal with custom precision.
func ParseFloat ¶
ParseFloat return new Decimal parsed from float64 * 1e8 (in GAS).
func ParseFloatWithPrecision ¶
ParseFloatWithPrecision returns new Decimal parsed from float64 * 1^p.
func (*Decimal) Descriptor ¶
func (*Decimal) GetPrecision ¶
func (*Decimal) MarshalToSizedBuffer ¶
func (*Decimal) ProtoMessage ¶
func (*Decimal) ProtoMessage()
func (*Decimal) XXX_DiscardUnknown ¶
func (m *Decimal) XXX_DiscardUnknown()
func (*Decimal) XXX_Marshal ¶
func (*Decimal) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.