convert

package
v0.0.0-...-2a4c2d2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 6 Imported by: 56

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(condition bool) *bool

BoolPtr takes in boolean condition and returns pointer version of it

func DecimalToHumanFriendlyString

func DecimalToHumanFriendlyString(number decimal.Decimal, rounding int, decPoint, thousandsSep string) string

DecimalToHumanFriendlyString converts a decimal number to a comma separated string at the thousand point eg 1000 becomes 1,000

func FloatFromString

func FloatFromString(raw interface{}) (float64, error)

FloatFromString format

func FloatToHumanFriendlyString

func FloatToHumanFriendlyString(number float64, decimals uint, decPoint, thousandsSep string) string

FloatToHumanFriendlyString converts a float to a comma separated string at the thousand point eg 1000 becomes 1,000

func Int64FromString

func Int64FromString(raw interface{}) (int64, error)

Int64FromString format

func IntFromString

func IntFromString(raw interface{}) (int, error)

IntFromString format

func IntToHumanFriendlyString

func IntToHumanFriendlyString(number int64, thousandsSep string) string

IntToHumanFriendlyString converts an int to a comma separated string at the thousand point eg 1000 becomes 1,000

func InterfaceToFloat64OrZeroValue

func InterfaceToFloat64OrZeroValue(r interface{}) float64

InterfaceToFloat64OrZeroValue returns the type assertion value or variable zero value

func InterfaceToIntOrZeroValue

func InterfaceToIntOrZeroValue(r interface{}) int

InterfaceToIntOrZeroValue returns the type assertion value or variable zero value

func InterfaceToStringOrZeroValue

func InterfaceToStringOrZeroValue(r interface{}) string

InterfaceToStringOrZeroValue returns the type assertion value or variable zero value

func TimeFromUnixTimestampDecimal

func TimeFromUnixTimestampDecimal(input float64) time.Time

TimeFromUnixTimestampDecimal converts a unix timestamp in decimal form to a time.Time in UTC

func TimeFromUnixTimestampFloat

func TimeFromUnixTimestampFloat(raw interface{}) (time.Time, error)

TimeFromUnixTimestampFloat format

func UnixTimestampStrToTime

func UnixTimestampStrToTime(timeStr string) (time.Time, error)

UnixTimestampStrToTime returns a time.time and an error

func UnixTimestampToTime

func UnixTimestampToTime(timeint64 int64) time.Time

UnixTimestampToTime returns time.time

Types

This section is empty.

Jump to

Keyboard shortcuts

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