Skip to content

Commit c1f11fc

Browse files
committed
add no_fraction_if_integer to Money.new! call
1 parent a5c7d98 commit c1f11fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/algora/shared/money_utils.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ defmodule Algora.MoneyUtils do
2626
# Why does ecto return {currency, amount} instead of Money.t()?
2727
def ensure_money_field(struct, field) do
2828
case Map.get(struct, field) do
29-
{currency, amount} -> Map.put(struct, field, Money.new!(currency, amount))
29+
{currency, amount} -> Map.put(struct, field, Money.new!(currency, amount, no_fraction_if_integer: true))
3030
_ -> struct
3131
end
3232
end

0 commit comments

Comments
 (0)