conv

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package conv contains basic data type conversion functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyToString

func AnyToString[T any](item T) string

AnyToString converts item to string

func AnyToStringList

func AnyToStringList[T any](items []T) []string

AnyToStringList converts each item to a string

func BoolToInt

func BoolToInt(b bool) int

BoolToInt converts bool to int (true = 1, false = 0)

func BoolToString

func BoolToString(b bool) string

BoolToString converts bool to string

func BoolToUint

func BoolToUint(b bool) uint

BoolToUint converts bool to uint (true = 1, false = 0)

func FloatToInt

func FloatToInt[F number.Float](f F) int

FloatToInt converts a Float to int

func FloatToString

func FloatToString[F number.Float](f F) string

FloatToString converts a Float to string

func FloatToUint

func FloatToUint[F number.Float](f F) uint

FloatToUint converts a Float to uint, clips to 0 if negative float

func IntToBool

func IntToBool[I number.Integer](i I) bool

IntToBool converts an Integer to bool (0 = false, else = true)

func IntToFloat

func IntToFloat[I number.Integer](i I) float64

IntToFloat converts an Integer to float64

func IntToString

func IntToString[I number.Integer](i I) string

IntToString converts an Integer to string

func IntToUint

func IntToUint[I number.Int](i I) uint

IntToUint converts an Int to uint, clips to 0 if negative int

func NotFn

func NotFn[T any](fn func(T) bool) func(T) bool

NotFn creates a function that negates the result of another function

func UintToInt

func UintToInt[I number.Uint](i I) int

UintToInt converts a Uint to int

Types

This section is empty.

Jump to

Keyboard shortcuts

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