Documentation
¶
Overview ¶
Package number contains number types and functions
Index ¶
- func Abs[T Type](x T) T
- func Ceil[F Float](f F) float64
- func CeilInt[F Float](f F) int
- func CommaDecimalString[F Float](f F, decimalPlaces uint) string
- func CommaString[I Integer](i I) string
- func DecimalString[F Float](f F, decimalPlaces uint) string
- func Floor[F Float](f F) float64
- func FloorInt[F Float](f F) int
- func ParseFloat(text string) float64
- func ParseInt(text string) int
- func ParseUint(text string) uint
- func Round[F Float](f F) float64
- func RoundInt[F Float](f F) int
- func RoundToEven[F Float](f F) float64
- func RoundToEvenInt[F Float](f F) int
- type Float
- type Int
- type Integer
- type Type
- type Uint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommaDecimalString ¶
CommaDecimalString returns the Float string, grouped by commas, using N decimal places
func CommaString ¶
CommaString returns the Integer string, grouped by commas
func DecimalString ¶
DecimalString returns the Float string, using N decimal places
func ParseFloat ¶
ParseFloat parses the string as float64, default to 0 if invalid float
func RoundToEven ¶
RoundToEven rounds the value to the nearest whole float64, with ties (0.5) rounding to nearest even number
func RoundToEvenInt ¶
RoundToEvenInt rounds the value to the nearest int, with ties (0.5) rounding to nearest even number
Types ¶
Click to show internal directories.
Click to hide internal directories.