PTAX.Money.Pair (ptax v1.0.0)

Defines a Currency Pair structure.

Link to this section Summary

Link to this section Types

@type t() :: %PTAX.Money.Pair{
  amount: Decimal.t(),
  base_currency: PTAX.Money.currency(),
  quoted_currency: PTAX.Money.currency()
}

Link to this section Functions

Link to this function

new(amount, base_currency, quoted_currency)

@spec new(amount :: any(), currency, currency) :: t()
when currency: PTAX.Money.currency()

Create a new currency pair.

Examples:

iex> PTAX.Money.Pair.new(2, :GBP, :USD)
%PTAX.Money.Pair{amount: Decimal.new(2), base_currency: :GBP, quoted_currency: :USD}