amount

package
v0.0.0-...-d1a261c Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 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 AmountType

type AmountType int64

func NewAmount

func NewAmount(f float64) (AmountType, error)

func (AmountType) Format

func (a AmountType) Format(u AmountUnit) string

func (AmountType) MulF64

func (a AmountType) MulF64(f float64) AmountType

func (AmountType) String

func (a AmountType) String() string

func (AmountType) ToNormalUnit

func (a AmountType) ToNormalUnit() float64

func (AmountType) ToUnit

func (a AmountType) ToUnit(u AmountUnit) float64

type AmountUnit

type AmountUnit int
const (
	AmountMega  AmountUnit = 6
	AmountKilo  AmountUnit = 3
	Amount      AmountUnit = 0
	AmountMilli AmountUnit = -3
	AmountMicro AmountUnit = -6
	AmountSats  AmountUnit = -8

	SatsPerUnit = 1e8
	MaxSats     = 21e6 * SatsPerUnit
)

Jump to

Keyboard shortcuts

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