SoftBank.Cldr.Money.cmp-exclamation-mark

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

Compares two Money values numerically and raises on error.

Arguments

  • money_1 and money_2 are any valid Money.t types returned by Money.new/2

Returns

  • -1 | 0 | 1 or

  • raises an exception

Examples

SoftBank.Cldr.Money.cmp! Money.new(:USD, 200), Money.new(:CAD, 500)
** (ArgumentError) Cannot compare monies with different currencies. Received :USD and :CAD.