Versions in this module Expand all Collapse all v0 v0.2.1 Oct 6, 2026 Changes in this version type Decimal + func (d *Decimal) UnmarshalGQL(v any) error + func (d Decimal) MarshalGQL(w io.Writer) type NullDecimal + func (n *NullDecimal) UnmarshalGQL(v any) error + func (n NullDecimal) MarshalGQL(w io.Writer) v0.2.0 Oct 6, 2026 Changes in this version + const MaxPrec + const MaxScale + const MinScale + var E = MustNew(2_718_281_828_459_045_235, 18) + var Hundred = MustNew(100, 0) + var NegOne = MustNew(-1, 0) + var One = MustNew(1, 0) + var Pi = MustNew(3_141_592_653_589_793_238, 18) + var Ten = MustNew(10, 0) + var Thousand = MustNew(1_000, 0) + var Two = MustNew(2, 0) + var Zero = MustNew(0, 0) + type Decimal struct + func Mean(d ...Decimal) (Decimal, error) + func MustNew(value int64, scale int) Decimal + func MustParse(s string) Decimal + func New(value int64, scale int) (Decimal, error) + func NewFromFloat64(f float64) (Decimal, error) + func NewFromInt64(whole, frac int64, scale int) (Decimal, error) + func Parse(s string) (Decimal, error) + func ParseExact(s string, scale int) (Decimal, error) + func Prod(d ...Decimal) (Decimal, error) + func Sum(d ...Decimal) (Decimal, error) + func (d *Decimal) Scan(value any) error + func (d *Decimal) UnmarshalBSONValue(typ byte, data []byte) error + func (d *Decimal) UnmarshalBinary(data []byte) error + func (d *Decimal) UnmarshalJSON(data []byte) error + func (d *Decimal) UnmarshalText(text []byte) error + func (d Decimal) Abs() Decimal + func (d Decimal) Add(e Decimal) (Decimal, error) + func (d Decimal) AddExact(e Decimal, scale int) (Decimal, error) + func (d Decimal) AddMul(e, f Decimal) (Decimal, error) + func (d Decimal) AddMulExact(e, f Decimal, scale int) (Decimal, error) + func (d Decimal) AddQuo(e, f Decimal) (Decimal, error) + func (d Decimal) AddQuoExact(e, f Decimal, scale int) (Decimal, error) + func (d Decimal) AppendBinary(data []byte) ([]byte, error) + func (d Decimal) AppendText(text []byte) ([]byte, error) + func (d Decimal) Ceil(scale int) Decimal + func (d Decimal) Clamp(min, max Decimal) (Decimal, error) + func (d Decimal) Cmp(e Decimal) int + func (d Decimal) CmpAbs(e Decimal) int + func (d Decimal) CmpTotal(e Decimal) int + func (d Decimal) Coef() uint64 + func (d Decimal) CopySign(e Decimal) Decimal + func (d Decimal) Equal(e Decimal) bool + func (d Decimal) Exp() (Decimal, error) + func (d Decimal) Expm1() (Decimal, error) + func (d Decimal) Float64() (f float64, ok bool) + func (d Decimal) Floor(scale int) Decimal + func (d Decimal) Format(state fmt.State, verb rune) + func (d Decimal) Int64(scale int) (whole, frac int64, ok bool) + func (d Decimal) Inv() (Decimal, error) + func (d Decimal) IsInt() bool + func (d Decimal) IsNeg() bool + func (d Decimal) IsOne() bool + func (d Decimal) IsPos() bool + func (d Decimal) IsZero() bool + func (d Decimal) Less(e Decimal) bool + func (d Decimal) Log() (Decimal, error) + func (d Decimal) Log10() (Decimal, error) + func (d Decimal) Log1p() (Decimal, error) + func (d Decimal) Log2() (Decimal, error) + func (d Decimal) MarshalBSONValue() (typ byte, data []byte, err error) + func (d Decimal) MarshalBinary() ([]byte, error) + func (d Decimal) MarshalJSON() ([]byte, error) + func (d Decimal) MarshalJSONTo(enc *jsontext.Encoder) error + func (d Decimal) MarshalText() ([]byte, error) + func (d Decimal) Max(e Decimal) Decimal + func (d Decimal) Min(e Decimal) Decimal + func (d Decimal) MinScale() int + func (d Decimal) Mul(e Decimal) (Decimal, error) + func (d Decimal) MulExact(e Decimal, scale int) (Decimal, error) + func (d Decimal) Neg() Decimal + func (d Decimal) One() Decimal + func (d Decimal) Pad(scale int) Decimal + func (d Decimal) Pow(e Decimal) (Decimal, error) + func (d Decimal) PowInt(power int) (Decimal, error) + func (d Decimal) Prec() int + func (d Decimal) Quantize(e Decimal) Decimal + func (d Decimal) Quo(e Decimal) (Decimal, error) + func (d Decimal) QuoExact(e Decimal, scale int) (Decimal, error) + func (d Decimal) QuoRem(e Decimal) (q, r Decimal, err error) + func (d Decimal) Rescale(scale int) Decimal + func (d Decimal) Round(scale int) Decimal + func (d Decimal) SameScale(e Decimal) bool + func (d Decimal) Scale() int + func (d Decimal) Sign() int + func (d Decimal) Sqrt() (Decimal, error) + func (d Decimal) String() string + func (d Decimal) Sub(e Decimal) (Decimal, error) + func (d Decimal) SubAbs(e Decimal) (Decimal, error) + func (d Decimal) SubExact(e Decimal, scale int) (Decimal, error) + func (d Decimal) SubMul(e, f Decimal) (Decimal, error) + func (d Decimal) SubMulExact(e, f Decimal, scale int) (Decimal, error) + func (d Decimal) SubQuo(e, f Decimal) (Decimal, error) + func (d Decimal) SubQuoExact(e, f Decimal, scale int) (Decimal, error) + func (d Decimal) Trim(scale int) Decimal + func (d Decimal) Trunc(scale int) Decimal + func (d Decimal) ULP() Decimal + func (d Decimal) Value() (driver.Value, error) + func (d Decimal) WithinOne() bool + func (d Decimal) Zero() Decimal + type NullDecimal struct + Decimal Decimal + Valid bool + func (n *NullDecimal) Scan(value any) error + func (n *NullDecimal) UnmarshalBSONValue(typ byte, data []byte) error + func (n *NullDecimal) UnmarshalJSON(data []byte) error + func (n NullDecimal) MarshalBSONValue() (typ byte, data []byte, err error) + func (n NullDecimal) MarshalJSON() ([]byte, error) + func (n NullDecimal) MarshalJSONTo(enc *jsontext.Encoder) error + func (n NullDecimal) Value() (driver.Value, error)