money

package
v0.0.0-...-354871b Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test()

Types

type Money

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

func NewMoneyFromDecimal

func NewMoneyFromDecimal(d decimal.Decimal) Money

func NewMoneyFromFloat

func NewMoneyFromFloat(value float64) Money

func NewMoneyFromString

func NewMoneyFromString(value string) (Money, error)

func (Money) Abs

func (m Money) Abs() Money

func (Money) Add

func (m Money) Add(value Money) Money

func (Money) Cmp

func (m Money) Cmp(value Money) int

func (Money) Div

func (m Money) Div(value Money) Money

func (Money) Equal

func (m Money) Equal(value Money) bool

func (Money) Float64

func (m Money) Float64() float64

func (Money) Floor

func (m Money) Floor() Money

func (Money) FloorWithDecimal

func (m Money) FloorWithDecimal(index int32) Money

func (Money) FormatNumber

func (m Money) FormatNumber() string

func (Money) FormatNumberWithPrecision

func (m Money) FormatNumberWithPrecision(precision int) string

func (Money) FormatNumberWithoutDecimal

func (m Money) FormatNumberWithoutDecimal() string

func (Money) FormatString

func (m Money) FormatString() string

func (Money) GreaterThan

func (m Money) GreaterThan(value Money) bool

func (Money) GreaterThanOrEqual

func (m Money) GreaterThanOrEqual(value Money) bool

func (Money) LessThan

func (m Money) LessThan(value Money) bool

func (Money) LessThanOrEqual

func (m Money) LessThanOrEqual(value Money) bool

func (Money) MarshalBSONValue

func (m Money) MarshalBSONValue() (bsontype.Type, []byte, error)

func (Money) MarshalJSON

func (m Money) MarshalJSON() ([]byte, error)

func (Money) MarshalText

func (m Money) MarshalText() (text []byte, err error)

MarshalText implements the encoding.TextMarshaler interface for XML serialization.

func (Money) MarshalXML

func (m Money) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (Money) Mul

func (m Money) Mul(value Money) Money

func (Money) Neg

func (m Money) Neg() Money

func (Money) Round

func (m Money) Round(num int32) Money

func (Money) Shift

func (m Money) Shift(shift int32) Money

func (Money) String

func (m Money) String() string

func (Money) Sub

func (m Money) Sub(value Money) Money

func (*Money) UnmarshalBSONValue

func (m *Money) UnmarshalBSONValue(dataType bsontype.Type, data []byte) error

func (*Money) UnmarshalJSON

func (m *Money) UnmarshalJSON(data []byte) error

func (*Money) UnmarshalText

func (m *Money) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for XML deserialization.

func (*Money) UnmarshalXML

func (m *Money) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*Money) UnmarshalXMLAttr

func (m *Money) UnmarshalXMLAttr(attr xml.Attr) error

Jump to

Keyboard shortcuts

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