Money.Input (Money.Input v0.1.0)

View Source

Locale-aware money form input.

This package ships:

For plain number inputs (no currency), see the sibling localize_inputs package — <.number_input> lives there.

Quick examples

iex> {:ok, money} = Money.Input.Cast.cast(
...>   %{"amount" => "1.234,56", "currency" => "EUR"},
...>   locale: :de
...> )
iex> Money.to_string!(money, locale: :de)
"1.234,56 €"

iex> Money.to_string!(Money.new(:USD, "1234.56"), locale: :en)
"$1,234.56"

iex> Money.to_string!(Money.new(:EUR, "1234.56"), locale: :de, currency_symbol: :none)
"1.234,56"

Summary

Functions

Returns the installed package version as a string.

Functions

version()

@spec version() :: String.t()

Returns the installed package version as a string.

Returns

  • The version string declared in mix.exs.

Examples

iex> Money.Input.version() |> Version.parse!()
iex> :ok
:ok