types

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount struct {
	*big.Int
}

Amount represense a NEAR yocto

func NewAmount

func NewAmount(src string) Amount

NewAmount returns a new amount from the given string

func NewFloatAmount

func NewFloatAmount(val string) Amount

func NewInt64Amount

func NewInt64Amount(val int64) Amount

NewInt64Amount returns a new amount for the given int64 value

func (Amount) Add

func (a Amount) Add(b Amount) Amount

Add adds two numbers

func (Amount) Compare

func (a Amount) Compare(b Amount) int

Compare compares two amounts

func (Amount) MarshalJSON

func (a Amount) MarshalJSON() ([]byte, error)

MarshalJSON returns a JSON representation of amount

func (Amount) Mul

func (a Amount) Mul(b Amount) Amount

Mul multiplies two numbers

func (Amount) PercentOf

func (a Amount) PercentOf(b Amount) float64

func (Amount) Quo added in v0.11.0

func (a Amount) Quo(b Amount) Amount

Quo divides two numbers

func (*Amount) Scan

func (a *Amount) Scan(value interface{}) error

Scan assigns the value from interface

func (Amount) String

func (a Amount) String() string

func (Amount) Sub

func (a Amount) Sub(b Amount) Amount

Sub substitutes a given amount from the current one

func (Amount) Value

func (a Amount) Value() (driver.Value, error)

Value returns a serialized value

type Float added in v0.11.0

type Float struct {
	*big.Float
}

func NewFloat added in v0.11.0

func NewFloat(src string) Float

NewFloat returns a new float from the given string

func NewFloat64Float added in v0.11.0

func NewFloat64Float(val float64) Float

NewFloat64Float returns a new float for the given float64 value

func (Float) Add added in v0.11.0

func (a Float) Add(b Float) Float

Add adds two numbers

func (Float) MarshalJSON added in v0.11.1

func (a Float) MarshalJSON() ([]byte, error)

func (Float) Mul added in v0.11.0

func (a Float) Mul(b Float) Float

Mul multiplies two numbers

func (Float) Quo added in v0.11.0

func (a Float) Quo(b Float) Float

Quo divides two numbers

func (*Float) Scan added in v0.11.0

func (a *Float) Scan(value interface{}) error

Scan assigns the value from interface

func (Float) String added in v0.11.0

func (a Float) String() string

func (Float) Sub added in v0.11.0

func (a Float) Sub(b Float) Float

Sub substitutes a given float amount from the current one

func (Float) Value added in v0.11.0

func (a Float) Value() (driver.Value, error)

Value returns a serialized value

Jump to

Keyboard shortcuts

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