floatx

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format[T constraints.Float](value T, decimals int) string

Format convert float to string, with decimals numbers.

func Max

func Max[T constraints.Float](value1, value2 T) T

Max return the larger one of float values

func Min

func Min[T constraints.Float](value1, value2 T) T

Min return the smaller one of float values

func Parse

func Parse[T constraints.Float](str string) (T, error)

Parse convert str to float.

func SafeParse

func SafeParse[T constraints.Float](str string, defaultValue T) T

SafeParse convert str to float. if str is not a illegal uint value representation, return defaultValue

func SimpleFormat

func SimpleFormat[T constraints.Float](value T) string

SimpleFormat convert float to string

Types

This section is empty.

Jump to

Keyboard shortcuts

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