unit

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceUnit

type BalanceUnit struct {
	*big.Int
}

func NewBalanceUnit

func NewBalanceUnit() *BalanceUnit

func NewBalanceUnitFromFloat

func NewBalanceUnitFromFloat(balanceF float64) *BalanceUnit

func NewBalanceUnitFromString

func NewBalanceUnitFromString(balanceS string) *BalanceUnit

func (*BalanceUnit) AddBalance

func (b *BalanceUnit) AddBalance(amount *BalanceUnit) error

AddBalance add amount into current balance

func (*BalanceUnit) SetFloatUnit

func (b *BalanceUnit) SetFloatUnit(value float64)

SetFloat to set amount or balance float to base unit

func (*BalanceUnit) SetStringUnit

func (b *BalanceUnit) SetStringUnit(value string)

func (*BalanceUnit) SubBalance

func (b *BalanceUnit) SubBalance(amount *BalanceUnit) error

SubBalance subtracts the current balance with amount

Jump to

Keyboard shortcuts

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