Versions in this module Expand all Collapse all v1 v1.0.0 Oct 26, 2026 Changes in this version + const MaxDigits + const MaxFractionDigits + var ErrDivByZero = errors.New("decimal: division by zero") + var ErrRange = errors.New("decimal: out of range") + var ErrSyntax = errors.New("decimal: invalid syntax") + type Decimal struct + var Zero Decimal + func Max(first Decimal, rest ...Decimal) Decimal + func Min(first Decimal, rest ...Decimal) Decimal + func MustFromString(v string) Decimal + func New(v int64, exp int32) Decimal + func NewFromFloat(v float64) Decimal + func NewFromInt(v int64) Decimal + func NewFromString(v string) (Decimal, error) + func Sum(first Decimal, rest ...Decimal) Decimal + func (d *Decimal) GobDecode(data []byte) error + func (d *Decimal) Scan(value any) error + func (d *Decimal) UnmarshalBinary(data []byte) error + func (d *Decimal) UnmarshalJSON(b []byte) error + func (d *Decimal) UnmarshalText(text []byte) error + func (d Decimal) Abs() Decimal + func (d Decimal) Add(o Decimal) Decimal + func (d Decimal) Append(b []byte) []byte + func (d Decimal) Ceil() Decimal + func (d Decimal) Cmp(o Decimal) int + func (d Decimal) Div(o Decimal) Decimal + func (d Decimal) Equal(o Decimal) bool + func (d Decimal) Exponent() int32 + func (d Decimal) Floor() Decimal + func (d Decimal) GobEncode() ([]byte, error) + func (d Decimal) GreaterThan(o Decimal) bool + func (d Decimal) GreaterThanOrEqual(o Decimal) bool + func (d Decimal) InexactFloat64() float64 + func (d Decimal) IsInteger() bool + func (d Decimal) IsNegative() bool + func (d Decimal) IsPositive() bool + func (d Decimal) IsZero() bool + func (d Decimal) LessThan(o Decimal) bool + func (d Decimal) LessThanOrEqual(o Decimal) bool + func (d Decimal) MarshalBinary() ([]byte, error) + func (d Decimal) MarshalJSON() ([]byte, error) + func (d Decimal) MarshalText() ([]byte, error) + func (d Decimal) Mul(o Decimal) Decimal + func (d Decimal) Neg() Decimal + func (d Decimal) Round(places int32) Decimal + func (d Decimal) RoundCeil(places int32) Decimal + func (d Decimal) RoundFloor(places int32) Decimal + func (d Decimal) RoundFloorSigFigs(sigFigs int32) Decimal + func (d Decimal) Sign() int + func (d Decimal) String() string + func (d Decimal) StringFixed(places int32) string + func (d Decimal) Sub(o Decimal) Decimal + func (d Decimal) TextLen() int + func (d Decimal) Truncate(places int32) Decimal + func (d Decimal) Value() (driver.Value, error)