Documentation
¶
Index ¶
- type Decimal
- func (this *Decimal) Add(another *Decimal) *Decimal
- func (this *Decimal) Cmp(another *Decimal) int
- func (this *Decimal) Div(another *Decimal) *Decimal
- func (this Decimal) Float() float64
- func (this Decimal) FloatString(precision int) string
- func (this *Decimal) Mul(another *Decimal) *Decimal
- func (this *Decimal) SetFloat(v float64) *Decimal
- func (this *Decimal) SetInt(v int64) *Decimal
- func (this *Decimal) SetString(v string) (*Decimal, error)
- func (this Decimal) Sign() int
- func (this Decimal) String() string
- func (this *Decimal) Sub(another *Decimal) *Decimal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decimal ¶
type Decimal struct {
// contains filtered or unexported fields
}
Decimal represents a decimal which can handing fixed precision.
func (*Decimal) Cmp ¶
Cmp compares this and another and returns: -1 if this < another
0 if this == another
+1 if this > another
func (Decimal) FloatString ¶
FloatString returns a string representation of decimal form with precision digits of precision after the decimal point and the last digit rounded.
Click to show internal directories.
Click to hide internal directories.