PTAX (ptax v0.1.0)
Documentation for PTAX
.
Link to this section Summary
Functions
Semelhante a converter/2
, mas gera um error se o valor não puder ser convertido.
Link to this section Types
Link to this type
converter_opts()
Specs
converter_opts() :: [ de: PTAX.Conversor.moeda(), para: PTAX.Conversor.moeda(), data: Date.t() | nil, operacao: PTAX.Conversor.operacao() | nil ]
Link to this section Functions
Link to this function
converter(valor, opts)
Specs
converter( valor :: PTAX.Conversor.valor(), opts :: converter_opts() | PTAX.Conversor.opts() ) :: {:ok, Decimal.t()} | {:error, any()}
Link to this function
converter!(valor, opts)
Specs
converter!( valor :: PTAX.Conversor.valor(), opts :: converter_opts() | PTAX.Conversor.opts() ) :: Decimal.t()
Semelhante a converter/2
, mas gera um error se o valor não puder ser convertido.
Exemplo
iex> PTAX.converter!(5, de: :USD, para: :BRL, data: ~D[2021-12-24], operacao: :compra)
#Decimal<28.2705>
Link to this function
moedas()
Specs
moedas() :: [PTAX.Moeda.t()] | {:error, term()}
See PTAX.Moeda.list/0
.