Money.zero

You're seeing just the function zero, go back to Money module for more information.
Link to this function

zero(money_or_currency, options \\ [])

View Source

Return a zero amount t:Money in the given currency.

Arguments

  • money_or_currency is either a t:Money or a currency code

  • options is a keyword list of options passed to Money.new/3. The default is [].

Example

iex> Money.zero(:USD)
#Money<:USD, 0>

iex> money = Money.new(:USD, 200)
iex> Money.zero(money)
#Money<:USD, 0>

iex> Money.zero :ZZZ
{:error, {Cldr.UnknownCurrencyError, "The currency :ZZZ is invalid"}}