Money.compare
You're seeing just the function
compare, go back to Money module for more information.
Specs
Compares two Money values numerically. If the first number is greater
than the second :gt is returned, if less than :lt is returned, if both
numbers are equal :eq is returned.
Arguments
money_1andmoney_2are any validMoney.ttypes returned byMoney.new/2
Returns
:gt|:eq|:ltor{:error, {module(), String.t}}
Examples
iex> Money.compare Money.new(:USD, 200), Money.new(:USD, 100)
:gt
iex> Money.compare Money.new(:USD, 200), Money.new(:USD, 200)
:eq
iex> Money.compare Money.new(:USD, 200), Money.new(:USD, 500)
:lt
iex> Money.compare Money.new(:USD, 200), Money.new(:CAD, 500)
{:error,
{ArgumentError,
"Cannot compare monies with different currencies. Received :USD and :CAD."}}