prices

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 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 NormalizedPrices

type NormalizedPrices map[*commodities.Commodity]decimal.Decimal

NormalizedPrices is a map representing the price of commodities in some base commodity.

func (NormalizedPrices) Valuate

Valuate valuates the given amount.

type Prices

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) Insert

func (p Prices) Insert(pr *ledger.Price)

Insert inserts a new price.

func (Prices) Normalize

func (p Prices) Normalize(c *commodities.Commodity) NormalizedPrices

Normalize creates a normalized price map for the given commodity.

Jump to

Keyboard shortcuts

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