Documentation ¶
Index ¶
- func AmountToFloat64(amount uint64, decimals uint8) float64
- func AmountToString(amount uint64, decimals uint8) string
- func AmountToUint64(amount float64, decimals uint8) uint64
- func AnyToString(v interface{}) string
- func Float64ToString(amount float64) string
- func GetVarType(v interface{}) string
- func IntAmountToFloat64(amount int64, decimals uint8) float64
- func ParseFileSize(s string) (int64, error)
- func Pointer[T any](v T) *T
- func PrettyPrint(v ...interface{})
- func PrettyString(v interface{}) string
- func StructToUrlValues(v interface{}) (url.Values, error)
- func TrimRightZeros(str string) string
- func TrimStringBetween(str, start, end string) string
- func UcFirst(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AmountToFloat64 ¶
AmountToFloat64 converts amount lamports to float64 with given decimals.
func AmountToString ¶
AmountToString converts amount lamports to string with given decimals.
func AmountToUint64 ¶
AmountToUint64 converts amount from float64 to uint64 with given decimals.
func Float64ToString ¶
Float64ToString converts float64 to string with minimum number of decimals. For example, 1.000000000 will be converted to "1", 1.100000000 will be converted to "1.1".
func GetVarType ¶
func GetVarType(v interface{}) string
GetVarType returns the type of the given variable as a string.
func IntAmountToFloat64 ¶
IntAmountToFloat64 converts int64 amount lamports to float64 with given decimals.
func ParseFileSize ¶
Parse file size from string to int64
func Pointer ¶
func Pointer[T any](v T) *T
Pointer is a helper to make a pointer to the given value.
func PrettyPrint ¶
func PrettyPrint(v ...interface{})
PrettyPrint prints the given interface in a pretty format
func PrettyString ¶
func PrettyString(v interface{}) string
PrettyString returns the given interface in a pretty format
func StructToUrlValues ¶
StructToUrlValues converts a struct to a url.Values object.
func TrimRightZeros ¶
TrimRightZeros trims trailing zeros from string.
func TrimStringBetween ¶
Trim string between two substrings and return the string without it and substrings.
Types ¶
This section is empty.