SoftBank.Cldr.Money.zero
You're seeing just the function
zero
, go back to SoftBank.Cldr.Money module for more information.
Specs
zero(Money.currency_code() | Money.t(), Keyword.t()) :: Money.t()
Return a zero amount t:Money
in the given currency.
Arguments
money_or_currency
is either at:Money
or a currency codeoptions
is a keyword list of options passed toMoney.new/3
. The default is[]
.
Example
iex> SoftBank.Cldr.Money.zero(:USD)
#Money<:USD, 0>
iex> money = Money.new(:USD, 200)
iex> SoftBank.Cldr.Money.zero(money)
#Money<:USD, 0>
iex> SoftBank.Cldr.Money.zero :ZZZ
{:error, {Cldr.UnknownCurrencyError, "The currency :ZZZ is invalid"}}