util

package
v0.0.0-...-13dad8c Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvInt

func GetEnvInt(key string, def int64) (r int64, err error)

GetEnvInt retrieves the given environment variable as an int and returns the given default if it is not set or a parsing error occurs

func GetEnvMillisAsDuration

func GetEnvMillisAsDuration(key string, def int64) time.Duration

GetEnvMillisAsDuration attempts to retrieve the given environment variable represented in milliseconds and parse it into a time.Duration. If the variable is not set the given default is returned. If an error occurs it is logged and the default is returned

func Round

func Round(val float64, roundOn float64, places int) (newVal float64)

Round rounds the given number to the requested precision

func RoundFloat32ToInt32

func RoundFloat32ToInt32(v float32) int32

RoundFloat32ToInt32 the given float as per standard math rounding rules

Types

This section is empty.

Jump to

Keyboard shortcuts

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