We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8411dbc commit 09d442dCopy full SHA for 09d442d
lib/algora/shared/money_utils.ex
@@ -3,6 +3,11 @@ defmodule Algora.MoneyUtils do
3
def fmt_precise(money), do: Money.to_string(money, no_fraction_if_integer: false)
4
def fmt_precise!(money), do: Money.to_string!(money, no_fraction_if_integer: false)
5
6
+ def fmt_compact(money) do
7
+ # TODO: handle other currencies
8
+ "$" <> Algora.Util.format_number_compact(money.amount)
9
+ end
10
+
11
@spec split_evenly(Money.t(), non_neg_integer()) :: [Money.t()]
12
def split_evenly(_money, 0), do: []
13
0 commit comments