Documentation
¶
Overview ¶
Package common global shared utils
Index ¶
- func AbsInt32(v int32) int32
- func AbsInt64(v int64) int64
- func Bytes2Str(b []byte) string
- func HumanReadableByteCount(bytes int64, si bool) (ret string)
- func Max[T Sortable](vals ...T) T
- func Min[T Sortable](vals ...T) T
- func Number2Roman(n int) (roman string)
- func Round(val float64, d int) float64
- func Str2Bytes(s string) []byte
- type Number
- type SortOrder
- type Sortable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HumanReadableByteCount ¶
HumanReadableByteCount convert bytes to human readable string
Args:
- bytes:
- si: `si ? 1024 : 1000`
Example:
`HumanReadableByteCount(1005, false) -> "1.01KB"`
Types ¶
type Number ¶
type Number interface { int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | float32 | float64 }
Number is a number type
Click to show internal directories.
Click to hide internal directories.