package
0.0.0-20250225133122-0516d5b855ff
Repository: https://github.com/domonda/go-types.git
Documentation: pkg.go.dev
# Functions
DerefOr dereferences ptr or returns defaultVal if ptr is nil.
Format a float similar to strconv.Format with the 'f' format option, but with decimalSep as decimal separator instead of a point and optional thousands grouping of the integer part.
NewFormatDef returns a format definition with a dot as decimal separator and no precision limit.
Parse a float string compatible with Format.
ParseDetails parses a float string compatible with Format and returns the detected integer thousands separator and decimal separator characters.
RoundToDecimals returns the float rounded to the passed number of decimal places.
Valid returns if the passed float is neither infinite nor NaN.
ValidAndHasSign returns true if Valid(f) and if it has the same sign than the passed non zero int argument.
# Type aliases
Tolerant is a float64 underneath that is tolerant in parsing non standard JSON.