Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a8f3f6f

Browse files
authoredJun 16, 2021
Merge pull request #127 from mediapress-ltd/jv-currency-formatting-performance
Allow Options struct in `to_string!/2` too and document it
2 parents 62056a7 + 64325b6 commit a8f3f6f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎lib/money.ex

+4-3
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ defmodule Money do
664664
* `money` is any valid `Money.t` type returned
665665
by `Money.new/2`
666666
667-
* `options` is a keyword list of options
667+
* `options` is a keyword list of options or a `%Cldr.Number.Format.Options{}` struct
668668
669669
## Returns
670670
@@ -742,7 +742,7 @@ defmodule Money do
742742
* `money` is any valid `Money.t` type returned
743743
by `Money.new/2`
744744
745-
* `options` is a keyword list of options
745+
* `options` is a keyword list of options or a `%Cldr.Number.Format.Options{}` struct
746746
747747
## Options
748748
@@ -766,7 +766,8 @@ defmodule Money do
766766
"1,234 US dollars"
767767
768768
"""
769-
@spec to_string!(Money.t(), Keyword.t()) :: String.t() | no_return()
769+
@spec to_string!(Money.t(), Keyword.t() | Cldr.Number.Format.Options.t()) ::
770+
String.t() | no_return()
770771

771772
def to_string!(%Money{} = money, options \\ []) do
772773
case to_string(money, options) do

0 commit comments

Comments
 (0)
Please sign in to comment.