numeric

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MIT Imports: 5 Imported by: 0

README

Build Status

numeric

Documentation

Index

Constants

View Source
const (
	Base10Encoding   = 10
	Uint64ByteLength = 8
	GUIDStringLength = 36
)

Variables

This section is empty.

Functions

func BinaryToUint64

func BinaryToUint64(bytes []byte) uint64

func GUIDToUint64

func GUIDToUint64(value string) uint64

func StringToUint64

func StringToUint64(value string) uint64

func TryUSDToCents

func TryUSDToCents(dollarAmount string) (amountInCents uint64, err error)

TryUSDToCents accepts a string in the form "$77,888.99" and returns the amount in USD cents as a uint64. It returns an error if the given dollar amount is invalid in any way. See unit tests for examples.

func USDToCents

func USDToCents(dollarAmount string) uint64

USDToCents forwards to TryUSDToCents but panics in the case of a non-nil error.

func Uint32ToGUID

func Uint32ToGUID(value uint32) string

func Uint64ToString

func Uint64ToString(value uint64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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