Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NormalizedPrices ¶
type NormalizedPrices map[*commodities.Commodity]decimal.Decimal
NormalizedPrices is a map representing the price of commodities in some base commodity.
func (NormalizedPrices) Valuate ¶
func (n NormalizedPrices) Valuate(c *commodities.Commodity, a decimal.Decimal) (decimal.Decimal, error)
Valuate valuates the given amount.
type Prices ¶
type Prices map[*commodities.Commodity]map[*commodities.Commodity]decimal.Decimal
Prices stores the price for a commodity to a target commodity Outer map: target commodity Inner map: commodity value: price in (target commodity / commodity)
func (Prices) Normalize ¶
func (p Prices) Normalize(c *commodities.Commodity) NormalizedPrices
Normalize creates a normalized price map for the given commodity.
Click to show internal directories.
Click to hide internal directories.