Documentation
¶
Index ¶
- func ExtractType(v reflect.Value) (reflect.Value, reflect.Kind)
- func FormatFloat[T Float](f T) string
- func FormatInteger[T Integer](n T) string
- func FormatUnsigned[T Unsigned](u T) string
- func GetFinalType(v any) (rt reflect.Type)
- func GetFloat[T Float](value reflect.Value) T
- func GetIndirectType(v any) (rt reflect.Type)
- func GetInteger[T Integer](value reflect.Value) T
- func GetUnsigned[T Unsigned](value reflect.Value) T
- func ParseFloat[T Float](s string) (T, error)
- func ParseInteger[T Integer](s string) (T, error)
- func ParseUnsigned[T Unsigned](s string) (T, error)
- func RoundN(x float64, n int) float64
- func SortedMapKeys(data any) (keys []string)
- type Decimal
- type Float
- type Integer
- type Number
- type Unit
- func (u *Unit) FromBool(b bool) error
- func (u Unit) FromFloat32(f float32) error
- func (u Unit) FromFloat64(f float64) error
- func (u Unit) FromInt(n int) error
- func (u Unit) FromInt16(n int16) error
- func (u Unit) FromInt32(n int32) error
- func (u Unit) FromInt64(n int64) error
- func (u Unit) FromInt8(n int8) error
- func (u Unit) FromStamp(t time.Time) error
- func (u *Unit) FromStr(s string) error
- func (u Unit) FromTime(t time.Time) error
- func (u Unit) FromUint(n uint) error
- func (u Unit) FromUint16(n uint16) error
- func (u Unit) FromUint32(n uint32) error
- func (u Unit) FromUint64(n uint64) error
- func (u Unit) FromUint8(n uint8) error
- func (u Unit) MustInt64() int64
- func (u Unit) String() string
- func (u Unit) ToBool() (bool, error)
- func (u Unit) ToFloat32() (float32, error)
- func (u Unit) ToFloat64() (float64, error)
- func (u Unit) ToInt() (int, error)
- func (u Unit) ToInt16() (int16, error)
- func (u Unit) ToInt32() (int32, error)
- func (u Unit) ToInt64() (int64, error)
- func (u Unit) ToInt8() (int8, error)
- func (u Unit) ToStamp() (t time.Time, err error)
- func (u Unit) ToStr() (string, error)
- func (u Unit) ToTime() (t time.Time, err error)
- func (u Unit) ToUint() (uint, error)
- func (u Unit) ToUint16() (uint16, error)
- func (u Unit) ToUint32() (uint32, error)
- func (u Unit) ToUint64() (uint64, error)
- func (u Unit) ToUint8() (uint8, error)
- type Unsigned
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractType ¶
ExtractType gets the actual underlying type of field value.
func ParseUnsigned ¶
ParseUnsigned 字符串转为无符号数,可能失败
Types ¶
type Decimal ¶
Decimal 高精度小数 例如 123.45 表示为 Decimal{Value:int64(12345), Precision:2}
func NewDecimal ¶
NewDecimal 使用方法:NewDecimal(123.45, 2)
func ParseDecimal ¶
ParseDecimal 使用方法:ParseDecimal("123.45", 2)
func (*Decimal) ChangePrecision ¶
func (*Decimal) HasFraction ¶
func (*Decimal) SetPrecision ¶
Click to show internal directories.
Click to hide internal directories.