decimal

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decimal

type Decimal struct {
	// contains filtered or unexported fields
}

func New

func New(value int64, exp int32) Decimal

func NewFromFloat

func NewFromFloat(value float64) Decimal

func NewFromInt

func NewFromInt(value int64) Decimal

func NewFromString

func NewFromString(value string) (Decimal, error)

func (*Decimal) Add

func (d *Decimal) Add(decimal Decimal) Decimal

func (*Decimal) Div

func (d *Decimal) Div(decimal Decimal) Decimal

func (*Decimal) Equal

func (d *Decimal) Equal(decimal Decimal) bool

func (*Decimal) IsNegative

func (d *Decimal) IsNegative() bool

func (*Decimal) IsPositive

func (d *Decimal) IsPositive() bool

func (*Decimal) IsZero

func (d *Decimal) IsZero() bool

func (*Decimal) Mul

func (d *Decimal) Mul(decimal Decimal) Decimal

func (*Decimal) Scan

func (d *Decimal) Scan(value interface{}) error

Scan implements the sql.Scanner interface for database deserialization.

func (*Decimal) String

func (d *Decimal) String() string

func (*Decimal) Sub

func (d *Decimal) Sub(decimal Decimal) Decimal

func (*Decimal) Truncate

func (d *Decimal) Truncate(precision int32) Decimal

func (Decimal) Value

func (d Decimal) Value() (driver.Value, error)

Value implements the driver.Valuer interface for database serialization.

type NullDecimal

type NullDecimal struct {
	Decimal Decimal
	Valid   bool
}

func (*NullDecimal) Scan

func (d *NullDecimal) Scan(value interface{}) error

Scan implements the sql.Scanner interface for database deserialization.

func (NullDecimal) Value

func (d NullDecimal) Value() (driver.Value, error)

Value implements the driver.Valuer interface for database serialization.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL