We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent be4e29c commit 5a157f9Copy full SHA for 5a157f9
1 file changed
test/money_test.exs
@@ -530,4 +530,16 @@ defmodule MoneyTest do
530
Application.put_env(:ex_money, :default_cldr_backend, money_backend)
531
Application.put_env(:ex_cldr, :default_backend, cldr_backend)
532
end
533
+
534
+ test "that format options propogate through operations" do
535
+ format_options = [fractional_digits: 4]
536
+ money = Money.new!(:USD, 100)
537
+ money_with_options = Money.new!(:USD, 100, format_options)
538
539
+ assert Money.add!(money, money_with_options).format_options == format_options
540
+ assert Money.sub!(money, money_with_options).format_options == format_options
541
+ assert Money.mult!(money_with_options, 3).format_options == format_options
542
+ assert Money.div!(money_with_options, 3).format_options == format_options
543
544
+ end
545
0 commit comments