Dinheiro v0.1.2 Moeda View Source

Documentation for Moeda.

Link to this section Summary

Functions

Return a map from an atom or string that represents an ISO 4217 code

Return an atom from a value that represents an ISO 4217 code

Return a multiplication factor from an ISO 4217 code

Link to this section Functions

Link to this function find(codigo) View Source
find(String.t() | atom()) :: map() | nil

Return a map from an atom or string that represents an ISO 4217 code.

Examples

iex> Moeda.find(:BRL)
%{ nome: "Brazilian Real", simbolo: "R$", codigo: "BRL", codigo_iso: 986, expoente: 2 }
iex> Moeda.find("BRL")
%{ nome: "Brazilian Real", simbolo: "R$", codigo: "BRL", codigo_iso: 986, expoente: 2 }
iex> Moeda.find("")
nil

Its function ignore case sensitive.

Examples

iex> Moeda.find(:brl)
%{ nome: "Brazilian Real", simbolo: "R$", codigo: "BRL", codigo_iso: 986, expoente: 2 }
iex> Moeda.find("brl")
%{ nome: "Brazilian Real", simbolo: "R$", codigo: "BRL", codigo_iso: 986, expoente: 2 }
Link to this function get_atom(codigo) View Source
get_atom(String.t() | atom()) :: atom() | nil

Return an atom from a value that represents an ISO 4217 code.

Examples

iex> Moeda.get_atom(:BRL)
:BRL
iex> Moeda.get_atom("BRL")
:BRL
iex> Moeda.get_atom("")
nil

Its function ignore case sensitive.

Examples

iex> Moeda.get_atom(:brl)
:BRL
iex> Moeda.get_atom("brl")
:BRL
Link to this function get_factor(codigo) View Source
get_factor(String.t() | atom()) :: float() | nil

Return a multiplication factor from an ISO 4217 code.

Examples

iex> Moeda.get_factor(:BRL)
100.0
iex> Moeda.get_factor("BRL")
100.0
iex> Moeda.get_factor("")
nil

Its function ignore case sensitive.

Examples

iex> Moeda.get_factor(:brl)
100.0
iex> Moeda.get_factor("brl")
100.0