utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Money

type Money struct {
	Amount   float64 `bson:"amount"`
	Currency string  `bson:"currency;omitempty"`
}

func NewMoney

func NewMoney(amount float64, currency string) Money

func (*Money) Add

func (m *Money) Add(amount float64) Money

func (*Money) AddMoney

func (m *Money) AddMoney(money Money) Money

func (*Money) AddWith

func (m *Money) AddWith(amount float64)

func (*Money) AddWithMoney

func (m *Money) AddWithMoney(money Money)

func (*Money) Ceil

func (m *Money) Ceil() Money

func (*Money) Compare

func (m *Money) Compare(other Money) int

func (*Money) Divide

func (m *Money) Divide(amount float64) Money

func (*Money) DivideMoney

func (m *Money) DivideMoney(money Money) Money

func (*Money) DivideWith

func (m *Money) DivideWith(amount float64)

func (*Money) DivideWithMoney

func (m *Money) DivideWithMoney(money Money)

func (*Money) Format added in v1.0.2

func (m *Money) Format() string

func (*Money) Multiply

func (m *Money) Multiply(amount float64) Money

func (*Money) MultiplyMoney

func (m *Money) MultiplyMoney(money Money) Money

func (*Money) MultiplyWith

func (m *Money) MultiplyWith(amount float64)

func (*Money) MultiplyWithMoney

func (m *Money) MultiplyWithMoney(money Money)

func (*Money) Round

func (m *Money) Round() Money

func (*Money) Substract

func (m *Money) Substract(amount float64) Money

func (*Money) SubstractMoney

func (m *Money) SubstractMoney(money Money) Money

func (*Money) SubstractWith

func (m *Money) SubstractWith(amount float64)

func (*Money) SubstractWithMoney

func (m *Money) SubstractWithMoney(money Money)

Jump to

Keyboard shortcuts

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