Documentation ¶
Index ¶
- func BoolPtr(condition bool) *bool
- func DecimalToHumanFriendlyString(number decimal.Decimal, rounding int, decPoint, thousandsSep string) string
- func FloatFromString(raw interface{}) (float64, error)
- func FloatToHumanFriendlyString(number float64, decimals uint, decPoint, thousandsSep string) string
- func Int64FromString(raw interface{}) (int64, error)
- func IntFromString(raw interface{}) (int, error)
- func IntToHumanFriendlyString(number int64, thousandsSep string) string
- func InterfaceToFloat64OrZeroValue(r interface{}) float64
- func InterfaceToIntOrZeroValue(r interface{}) int
- func InterfaceToStringOrZeroValue(r interface{}) string
- func TimeFromUnixTimestampDecimal(input float64) time.Time
- func TimeFromUnixTimestampFloat(raw interface{}) (time.Time, error)
- func UnixTimestampStrToTime(timeStr string) (time.Time, error)
- func UnixTimestampToTime(timeint64 int64) time.Time
- type ExchangeTime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 IntToHumanFriendlyString ¶
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 ¶
TimeFromUnixTimestampDecimal converts a unix timestamp in decimal form to a time.Time
func TimeFromUnixTimestampFloat ¶
TimeFromUnixTimestampFloat format
func UnixTimestampStrToTime ¶
UnixTimestampStrToTime returns a time.time and an error
func UnixTimestampToTime ¶
UnixTimestampToTime returns time.time
Types ¶
type ExchangeTime ¶
ExchangeTime provides timestamp to time conversion method.
func (ExchangeTime) Time ¶
func (k ExchangeTime) Time() time.Time
Time returns a time.Time instance from ExchangeTime instance object.
func (*ExchangeTime) UnmarshalJSON ¶
func (k *ExchangeTime) UnmarshalJSON(data []byte) error
UnmarshalJSON is custom type json unmarshaller for ExchangeTime