decimal

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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