Money.div-exclamation-mark

You're seeing just the function div-exclamation-mark, go back to Money module for more information.

Specs

div!(t(), Cldr.Math.number_or_decimal()) :: t() | none()

Divide a Money value by a number and raise on error.

Arguments

  • money is any valid Money.t types returned by Money.new/2

  • number is an integer, float or Decimal.t

Returns

  • a Money.t struct or

  • raises an exception

Examples

iex> Money.div!(Money.new(:USD, 200), 2)
#Money<:USD, 100>

iex> Money.div!(Money.new(:USD, 200), "xx")
** (ArgumentError) Cannot divide money by "xx"