Documentation ¶
Index ¶
- Constants
- Variables
- func NumFractionalDigits(a Value) int
- func Parse(input string) (num int64, numDecimalPoints int, err error)
- type Value
- func Max(a, b Value) Value
- func Min(a, b Value) Value
- func Must(v Value, err error) Value
- func MustNewFromString(input string) Value
- func NewFromFloat(val float64) Value
- func NewFromFloat32(val float32) Value
- func NewFromInt(val int) Value
- func NewFromInt64(val int64) Value
- func NewFromString(input string) (Value, error)
- func (v Value) Add(v2 Value) Value
- func (v *Value) AtomicAdd(v2 Value)
- func (v *Value) AtomicLoad() Value
- func (v Value) Div(v2 Value) Value
- func (v Value) Float64() float64
- func (v Value) Floor() Value
- func (v Value) Int64() int64
- func (v Value) MarshalJSON() ([]byte, error)
- func (v Value) Mul(v2 Value) Value
- func (v Value) MulFloat64(v2 float64) Value
- func (v *Value) Scan(src interface{}) error
- func (v Value) Sub(v2 Value) Value
- func (v *Value) UnmarshalJSON(data []byte) error
- func (v *Value) UnmarshalYAML(unmarshal func(a interface{}) error) (err error)
- func (v Value) Value() (driver.Value, error)
Constants ¶
View Source
const DefaultPow = 1e8
View Source
const DefaultPrecision = 8
View Source
const MaxPrecision = 12
Variables ¶
View Source
var ErrPrecisionLoss = errors.New("precision loss")
Functions ¶
func NumFractionalDigits ¶
Types ¶
type Value ¶
type Value int64
func MustNewFromString ¶
func NewFromFloat ¶
func NewFromFloat32 ¶
func NewFromInt ¶
func NewFromInt64 ¶
func NewFromString ¶
func (*Value) AtomicLoad ¶
func (Value) MarshalJSON ¶
func (Value) MulFloat64 ¶
func (*Value) UnmarshalJSON ¶
func (*Value) UnmarshalYAML ¶
Click to show internal directories.
Click to hide internal directories.