numeral

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormalizeUnitToByte

func FormalizeUnitToByte(raw string) (int64, error)

Formalize every readable unit (e.g. 10Mi 100G 30K 1024) to byte

func MaxFloat64

func MaxFloat64(nums []float64) float64

MaxFloat64 return the maximum num of nums.

1, 2, 3, 4, 5, 0 => 5

func MinFloat64

func MinFloat64(nums []float64, ignoreZeroOpt ...bool) float64

MinFloat64 return the minimal num of nums.

1, 2, 3, 4, 5, 0 => 0 1, 2, 3, 4, 5, 0 (ignoreZero) => 1

func Round

func Round(f float64, n int) float64

Round 保留小数点计算

func SubFloat64

func SubFloat64(f1, f2 float64) float64

SubFloat64 means (f1 - f2)

Types

This section is empty.

Jump to

Keyboard shortcuts

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