Documentation ¶
Index ¶
- func AbsFloat(num float64) float64
- func AbsFloat64(num float64) float64
- func AbsInt(num int) int
- func AbsInt64(num int64) int64
- func Average(nums ...interface{}) float64
- func AverageFloat(nums ...float64) float64
- func AverageFloat64(nums ...float64) float64
- func AverageInt(nums ...int) float64
- func AverageInt64(nums ...int64) float64
- func Compare(f1, f2 float64, places ...int) int
- func Equal(f1, f2 float64, places ...int) bool
- func GreaterThan(f1, f2 float64, places ...int) bool
- func GreaterThanOrEqual(f1, f2 float64, places ...int) bool
- func IsEven(num int64) bool
- func IsNegative(f float64) bool
- func IsNonNegative(f float64) bool
- func IsNonPositive(f float64) bool
- func IsOdd(num int64) bool
- func IsPositive(f float64) bool
- func IsZero(f float64) bool
- func LessThan(f1, f2 float64, places ...int) bool
- func LessThanOrEqual(f1, f2 float64, places ...int) bool
- func Max(nums ...interface{}) float64
- func MaxFloat(nums ...float64) float64
- func MaxFloat64(nums ...float64) float64
- func MaxInt(nums ...int) int
- func MaxInt64(nums ...int64) int64
- func Min(nums ...interface{}) float64
- func MinFloat(nums ...float64) float64
- func MinFloat64(nums ...float64) float64
- func MinInt(nums ...int) int
- func MinInt64(nums ...int64) int64
- func NumberFormat(num float64, places int, separator ...string) string
- func Percent(num, total interface{}) float64
- func RandFloat(min, max float64) float64
- func RandFloat64(min, max float64) float64
- func RandInt(min, max int) int
- func RandInt64(min, max int64) int64
- func RangeFloat(start, stop float64, step ...float64) []float64
- func RangeFloat64(start, stop float64, step ...float64) []float64
- func RangeInt(start, stop int, step ...int) []int
- func RangeInt64(start, stop int64, step ...int64) []int64
- func Round(f float64, places int) float64
- func RoundBank(f float64, places int) float64
- func RoundBankToString(f float64, places int) string
- func RoundToString(f float64, places int) string
- func Sign(f float64) int
- func SizeFormat(size float64, places int, separator ...string) string
- func Sum(nums ...interface{}) float64
- func SumFloat(nums ...float64) float64
- func SumFloat64(nums ...float64) float64
- func SumInt(nums ...int) int
- func SumInt64(nums ...int64) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsFloat64 ¶
AbsFloat64 returns the absolute float64 value of float64 num.
func Average ¶
func Average(nums ...interface{}) float64
Average returns the float64 average of nums.
func AverageFloat ¶
AverageFloat returns the float64 average of float64 nums.
func AverageFloat64 ¶
AverageFloat64 returns the float64 average of float64 nums.
func AverageInt ¶
AverageInt returns the float64 average of int nums.
func AverageInt64 ¶
AverageInt64 returns the float64 average of int64 nums.
func Compare ¶
Compare compares f1 and f2 and returns:
-1 if f1 < f2 0 if | f1 - f2 | <= 10 ^ -places, default places is 9 +1 if f1 > f2
func GreaterThan ¶
GreaterThan (GT) returns true when f1 is greater than f2.
func GreaterThanOrEqual ¶
GreaterThanOrEqual (GTE) returns true when f1 is greater than or equal to f2.
func LessThanOrEqual ¶
LessThanOrEqual (LTE) returns true when f1 is less than or equal to f2.
func MaxFloat64 ¶
MaxFloat64 returns the largest float64 number in float64 nums.
func MinFloat64 ¶
MinFloat64 returns the smallest float64 number in float64 nums.
func NumberFormat ¶
NumberFormat returns the formatted num with grouped thousands.
func Percent ¶
func Percent(num, total interface{}) float64
Percent returns the float64 percentage of num in total.
func RandFloat64 ¶
RandFloat64 returns float64 pseudo-random number in [min, max).
func RangeFloat ¶
RangeFloat returns a float64 slice, starting from float64 start, and increments by float64 step, and stops before float64 stop. If start < stop, default step is 1, else default step is -1.
func RangeFloat64 ¶
RangeFloat64 returns a float64 slice, starting from float64 start, and increments by float64 step, and stops before float64 stop. If start < stop, default step is 1, else default step is -1.
func RangeInt ¶
RangeInt returns a int slice, starting from int start, and increments by int step, and stops before int stop. If start < stop, default step is 1, else default step is -1.
func RangeInt64 ¶
RangeInt64 returns a int64 slice, starting from int64 start, and increments by int64 step, and stops before int64 stop. If start < stop, default step is 1, else default step is -1.
func RoundBankToString ¶
RoundBankToString returns a banker rounded fixed-point string with places digits after the f point.
func RoundToString ¶
RoundToString returns a rounded fixed-point string with places digits after the f point.
func SizeFormat ¶
SizeFormat returns the formatted size with storage unit.
func SumFloat64 ¶
SumFloat64 returns the float64 sum of float64 nums.
Types ¶
This section is empty.