Documentation
¶
Index ¶
Constants ¶
View Source
const ( CodeKZT = "KZT" CodeUSD = "USD" CodeRUB = "RUB" CodeEUR = "EUR" )
Variables ¶
View Source
var (
ErrBadCurrency = errors.New("bad currency")
)
View Source
var (
ErrBadMinorUnit = errors.New("bad currency minor unit")
)
Functions ¶
This section is empty.
Types ¶
type Currency ¶
type Currency uint32
Currency is a currency type
func ParseCurrency ¶
ParseCurrency returns Currency or Unknown.
func (Currency) MinorUnits ¶
func (c Currency) MinorUnits() MinorUnits
MinorUnits returns minor units of currency or MinorUnitsUnknown.
type ISO4217 ¶
type ISO4217 struct { Name string AlphabeticCode string NumericCode uint16 MinorUnits MinorUnits }
type MinorUnits ¶
type MinorUnits uint8
MinorUnits is a type for currency's minor units
const ( MinorUnitsUnknown MinorUnits = 255 MinorUnits0 MinorUnits = 0 MinorUnits2 MinorUnits = 2 MinorUnits3 MinorUnits = 3 )
func (MinorUnits) String ¶
func (m MinorUnits) String() string
String returns string value of minor units
func (MinorUnits) Validate ¶
func (m MinorUnits) Validate() error
Validate validates minor unit, on error returns ErrBadMinorUnit.
func (MinorUnits) Zero ¶
func (m MinorUnits) Zero() string
Zero returns zero value for minor unit.
Example: MinorUnits(2).Zero // "00"
Click to show internal directories.
Click to hide internal directories.