Versions in this module Expand all Collapse all v0 v0.8.11 Sep 19, 2017 v0.8.10 Feb 1, 2017 Changes in this version + const BinarySI + const DecimalExponent + const DecimalSI + var ErrFormatWrong = errors.New("quantities must match the regular expression '" + splitREString + "'") + var ErrNumeric = errors.New("unable to parse numeric part of quantity") + var ErrSuffix = errors.New("unable to parse quantity's suffix") + var MaxMilliValue = int64(((1 << 63) - 1) / 1000) + var Zero = int64Amount + func NewQuantityFlagValue(q *Quantity) flag.Value + type CanonicalValue interface + AsCanonicalBase1024Bytes func(out []byte) ([]byte, int32) + AsCanonicalBytes func(out []byte) ([]byte, int32) + type Format string + type Quantity struct + func MustParse(str string) Quantity + func NewMilliQuantity(value int64, format Format) *Quantity + func NewQuantity(value int64, format Format) *Quantity + func NewScaledQuantity(value int64, scale Scale) *Quantity + func ParseQuantity(str string) (Quantity, error) + func QuantityFlag(flagName, defaultValue, description string) *Quantity + func (q *Quantity) Add(y Quantity) + func (q *Quantity) AsCanonicalBytes(out []byte) (result []byte, exponent int32) + func (q *Quantity) AsDec() *inf.Dec + func (q *Quantity) AsInt64() (int64, bool) + func (q *Quantity) AsScale(scale Scale) (CanonicalValue, bool) + func (q *Quantity) CanonicalizeBytes(out []byte) (result, suffix []byte) + func (q *Quantity) Cmp(y Quantity) int + func (q *Quantity) CmpInt64(y int64) int + func (q *Quantity) Copy() *Quantity + func (q *Quantity) IsZero() bool + func (q *Quantity) MilliValue() int64 + func (q *Quantity) Neg() + func (q *Quantity) RoundUp(scale Scale) bool + func (q *Quantity) ScaledValue(scale Scale) int64 + func (q *Quantity) Set(value int64) + func (q *Quantity) SetMilli(value int64) + func (q *Quantity) SetScaled(value int64, scale Scale) + func (q *Quantity) Sign() int + func (q *Quantity) String() string + func (q *Quantity) Sub(y Quantity) + func (q *Quantity) ToDec() *Quantity + func (q *Quantity) UnmarshalJSON(value []byte) error + func (q *Quantity) Value() int64 + func (q Quantity) MarshalJSON() ([]byte, error) + type Scale int32 + const Exa + const Giga + const Kilo + const Mega + const Micro + const Milli + const Nano + const Peta + const Tera