decimal

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConvertStringInt = errors.New("failed to convert string to big int")
View Source
var File_token_decimal_decimal_proto protoreflect.FileDescriptor

Functions

func BigIntSub

func BigIntSub(a, b *big.Int) *big.Int

func BigIntSum

func BigIntSum(a, b *big.Int) *big.Int

Types

type Decimal

type Decimal struct {
	Scale int32  `protobuf:"varint,1,opt,name=scale,proto3" json:"scale,omitempty"` // scale ( same as decimal in ERC-20 )
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`  // big.Int as string
	// contains filtered or unexported fields
}

func BigIntSubAsDecimal

func BigIntSubAsDecimal(a, b *big.Int, scale ...int32) *Decimal

func BigIntSumAsDecimal

func BigIntSumAsDecimal(a, b *big.Int, scale ...int32) *Decimal

func New

func New(val *big.Int, scale ...int32) *Decimal

func (*Decimal) BigInt

func (x *Decimal) BigInt() (*big.Int, error)

func (*Decimal) Descriptor deprecated

func (*Decimal) Descriptor() ([]byte, []int)

Deprecated: Use Decimal.ProtoReflect.Descriptor instead.

func (*Decimal) GetScale

func (x *Decimal) GetScale() int32

func (*Decimal) GetValue

func (x *Decimal) GetValue() string

func (*Decimal) ProtoMessage

func (*Decimal) ProtoMessage()

func (*Decimal) ProtoReflect

func (x *Decimal) ProtoReflect() protoreflect.Message

func (*Decimal) Reset

func (x *Decimal) Reset()

func (*Decimal) String

func (x *Decimal) String() string

func (*Decimal) Validate

func (this *Decimal) Validate() error

Jump to

Keyboard shortcuts

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