Documentation ¶
Index ¶
- type Decimal
- func (d *Decimal) Clone() *Decimal
- func (d *Decimal) DivideUint64(u uint64) *Decimal
- func (d Decimal) Float64() float64
- func (d *Decimal) FromFloat64(f float64)
- func (d *Decimal) FromString(s string) error
- func (d *Decimal) FromStringFuzzy(s string) error
- func (d Decimal) MarshalCBOR() ([]byte, error)
- func (d Decimal) MarshalJSON() ([]byte, error)
- func (d *Decimal) MultiplyUint64(u uint64) *Decimal
- func (d *Decimal) Scan(value interface{}) error
- func (d Decimal) String() string
- func (d *Decimal) ToDigits(digits uint8) *Decimal
- func (d *Decimal) UnmarshalCBOR(data []byte) error
- func (d *Decimal) UnmarshalJSON(data []byte) error
- func (d Decimal) Value() (driver.Value, error)
- type Number
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decimal ¶
type Decimal struct { Negative bool Integer uint64 Fraction uint64 Digits uint8 // Number of digits in Fraction, must be less or equal to 20, not all values with 20 digits can be represented due to limits of uint64 }
func NewFromString ¶
func NewFromStringFuzzy ¶
NewFromStringFuzzy extracts and parses the first number from a string, ignoring any leading or trailing non-numeric characters.
func (*Decimal) DivideUint64 ¶
func (*Decimal) FromFloat64 ¶
func (*Decimal) FromString ¶
func (*Decimal) FromStringFuzzy ¶
FromStringFuzzy extracts and parses the first number from a string, ignoring any leading or trailing non-numeric characters.
func (Decimal) MarshalCBOR ¶
func (Decimal) MarshalJSON ¶
func (*Decimal) MultiplyUint64 ¶
func (*Decimal) UnmarshalCBOR ¶
func (*Decimal) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.