util

package
v0.0.0-...-cd02152 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const ISOFormat = "2006-01-02 15:04:05-07:00"

Variables

This section is empty.

Functions

func AdaptStake

func AdaptStake(stake float64, currency float64, roundValue float64) float64

func Compare

func Compare(a string, b string) float64

func FloatToStr

func FloatToStr(value float64) string

func Int64InList

func Int64InList(needle int64, haystack []int64) bool

func MaxFloat

func MaxFloat(values ...float64) (max float64)

func Normalize

func Normalize(s string) string

func PtrFloat64

func PtrFloat64(v float64) *float64

func PtrString

func PtrString(v string) *string

func RoundDown

func RoundDown(value float64, roundValue float64) float64

func StringInList

func StringInList(needle string, haystack []string) bool

func TimeId

func TimeId(seed int8) int64

func ToUSD

func ToUSD(value float64, currency float64) float64

func ToUSDInt

func ToUSDInt(value float64, currency float64) int64

func TruncateFloat

func TruncateFloat(value float64, precision int32) float64

Truncate truncates off digits from the number, without rounding.

NOTE: precision is the last digit that will not be truncated (must be >= 0).

Example:

decimal.NewFromString("123.456").Truncate(2).String() // "123.45"

func UnixMsNow

func UnixMsNow() int64

func UnixUsNow

func UnixUsNow() int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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