decimal

package
v0.0.5-rc-1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAmount

func ParseAmount(amount string) (result *decimal.Decimal, err error)

func TargetAmount

func TargetAmount(sourceDecimals uint8, targetDecimals uint8, sourceAmount *big.Int) *big.Int

TargetAmount converts the provided source amount to a target amount, based on the source & destination decimals Example: sourceDecimals 8, targetDecimals 8, source amount 1 000 => target amount 1 000 Example: sourceDecimals 9, targetDecimals 8, source amount 1 000 => target amount 100 Example: sourceDecimals 8, targetDecimals 9, source amount 1 000 => target amount 10 000

func ToLowestDenomination

func ToLowestDenomination(amount decimal.Decimal, decimals uint8) *big.Int

ToLowestDenomination decimal amount to the lowest denomination

Types

This section is empty.

Jump to

Keyboard shortcuts

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