Documentation ¶
Index ¶
- type Snum
- func (t *Snum) Abs()
- func (t *Snum) Add(sn *Snum)
- func (t *Snum) Cmp(sn *Snum) int
- func (t *Snum) Copy() *Snum
- func (t *Snum) Div(sn *Snum)
- func (t *Snum) GetRaw() (bigNum *big.Int, lenDecimal int, isMinus bool)
- func (t *Snum) GetStr() (sn string)
- func (t *Snum) GetUint64() (u8 uint64, err error)
- func (t *Snum) GroupDown(step int)
- func (t *Snum) GroupUp(step int)
- func (t *Snum) Init()
- func (t *Snum) IsZero() bool
- func (t *Snum) IsZeroOver() bool
- func (t *Snum) IsZeroUnder() bool
- func (t *Snum) MarshalJSON() ([]byte, error)
- func (t *Snum) Mul(sn *Snum)
- func (t *Snum) Neg()
- func (t *Snum) Pow(num int64)
- func (t *Snum) Round(step int)
- func (t *Snum) RoundDown(step int)
- func (t *Snum) RoundUp(step int)
- func (t *Snum) SetRaw(big *big.Int, lenDecimal int, isMinus bool)
- func (t *Snum) SetStr(sn string) (err error)
- func (t *Snum) SetUint64(u8 uint64) (err error)
- func (t *Snum) SetZero()
- func (t *Snum) String() string
- func (t *Snum) Sub(sn *Snum)
- func (t *Snum) TrimDigit(lenInteger, lenDecimal int) error
- func (t *Snum) UnmarshalJSON(bt []byte) error
- type SnumConst
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Snum ¶
type Snum struct {
// contains filtered or unexported fields
}
func (*Snum) GroupDown ¶
Output:
x step GroupDown Group_up 123.321 -4 123.321 123.321 123.321 -3 123.321 123.321 123.321 -2 123.32 123.33 123.321 -1 123.3 123.4 123.321 0 123 124 123.321 1 120 130 123.321 2 100 200 123.321 3 0 1000 123.321 4 0 10000
func (*Snum) IsZeroOver ¶
func (*Snum) IsZeroUnder ¶
func (*Snum) MarshalJSON ¶
func (*Snum) Round ¶
Output:
x Round Round_down Round_up 2.9 3 2 3 2.5 2 2 3 2.1 2 2 3 2 2 2 2
-2 -2 -2 -2 -2.1 -2 -2 -3 -2.5 -3 -2 -3 -2.9 -3 -2 -3
func (*Snum) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.