conversion

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyArrayToFloat64Array

func AnyArrayToFloat64Array(input any) ([]float64, bool)

func AnyArrayToStringArray

func AnyArrayToStringArray(input any) ([]string, bool)

func BToGiB

func BToGiB(b uint64) uint64

Convert bytes to gibibytes.

func BToKiB

func BToKiB(b uint64) uint64

Convert bytes to kibibytes.

func BToMiB

func BToMiB(b uint64) uint64

Convert bytes to mebibytes.

func BToTiB

func BToTiB(b uint64) uint64

Convert bytes to tebibytes.

func Canonicalise

func Canonicalise(value any) (any, bool)

Canonicalise a value to a standard type for that value.

e.g. `int` becomes `int64`.

func GiBToB

func GiBToB(b uint64) uint64

Convert gibibytes to bytes.

func KiBToB

func KiBToB(b uint64) uint64

Convert kibibytes to bytes.

func MiBToB

func MiBToB(b uint64) uint64

Convert mebibytes to bytes.

func NumericArrayToFloat64

func NumericArrayToFloat64[T Number](in []T) []float64

func TiBToB

func TiBToB(b uint64) uint64

Convert tebibytes to bytes.

func ToBool

func ToBool(value any) (bool, bool)

func ToComplex128

func ToComplex128(value any) (complex128, bool)

Convert a value to a 128-bit complex number.

func ToFloat64

func ToFloat64(val any) (float64, bool)

Convert a value to a 64-bit floating-point value.

func ToInt64

func ToInt64(value any) (int64, bool)

func ToString

func ToString(value any) (string, bool)

Convert a value to a string.

func ToUint64

func ToUint64(value any) (uint64, bool)

Types

type Number

type Number interface {
	constraints.Integer | constraints.Float
}

Jump to

Keyboard shortcuts

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