numbers

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AmountEthUnit   = "1000000000000000000" // in wei (1 eth)
	AmountKnstlUnit = "1000000"             // in udarc (1 darc)
	AmountSolUnit   = "1000000"             // in udarc (1 qdarc)
)

Variables

AmountUnitByChain is a map for getting chain unit of amount.

Functions

func DecimalToSatoshis

func DecimalToSatoshis(dec string) (string, error)

func FloatDecPlaces

func FloatDecPlaces(v float64) int

func GetTxAmountByChain

func GetTxAmountByChain(amount float64, chain types.ChainType) (decimal.Decimal, error)

GetTxAmountByChain converts float string to blockchain unit amount. Example 1: [BSC] amount "0.0001" -> "100000000000000" Example 2: [KNSTL] amount "2.05" -> "2050000"

Types

This section is empty.

Jump to

Keyboard shortcuts

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