money

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrencyCode

type CurrencyCode string

CurrencyCode is a three-letter currency code defined in ISO 4217.

const (
	EUR CurrencyCode = "EUR"
	GBP CurrencyCode = "GBP"
)

List of ISO 4217 codes.

type Money

type Money struct {
	Code CurrencyCode
	// Amount of money as integer number of minor units. For instance 3.56€ is
	// 356 because EUR has two decimals.
	Amount int64
}

Money represents an amount of money with its currency type.

func (*Money) Scan

func (m *Money) Scan(value interface{}) error

Scan implements the sql.Scanner interface.

func (Money) Value

func (m Money) Value() (driver.Value, error)

Value implements the sql.Valuer interface.

Jump to

Keyboard shortcuts

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