extensions

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package extensions provides functions that extend basic Go types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToString added in v1.2.0

func ConvertToString(v any) string

ConvertToString converts the input value to a string. If a conversion cannot be made, an empty string is returned.

func FloatToString

func FloatToString(number float64, format string) string

FloatToString converts a float to a string. Trailing zeroes will be trimmed. The decimal will be trimmed if no trailing zeroes are present.

func ScaleString

func ScaleString(s string, scale float64) string

ScaleString scales the numbers in the string in-place. The string may contain fractions.

func SumString

func SumString(s string) float64

SumString sums consecutive numbers in a string.

func Unique

func Unique[T comparable](xt []T) []T

Unique removes duplicates from the slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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