currency

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PicoDollarsPerDollar = 1e12
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PicoDollar

type PicoDollar int64

Picodollar is a type to represent currency with 12 decimal precision

func FromDollars

func FromDollars(dollars float64) (PicoDollar, error)

FromDollars converts a dollar amount (as a float) to Picodollars This should mostly be used for testing, and real usage should be done purely in PicoDollars

func (PicoDollar) String

func (p PicoDollar) String() string

func (PicoDollar) ToMicroDollars

func (p PicoDollar) ToMicroDollars() int64

ToMicroDollars converts PicoDollars to MicroDollars (1e6 units per dollar)

Jump to

Keyboard shortcuts

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