From 64325b61b1b8f32f032821b639ee1ccd0a0c50da Mon Sep 17 00:00:00 2001 From: Jeroen Visser Date: Wed, 16 Jun 2021 21:51:18 +0200 Subject: [PATCH] Allow Options struct in `to_string!/2` too and document it --- lib/money.ex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/money.ex b/lib/money.ex index b925650..3dd56ad 100644 --- a/lib/money.ex +++ b/lib/money.ex @@ -664,7 +664,7 @@ defmodule Money do * `money` is any valid `Money.t` type returned by `Money.new/2` - * `options` is a keyword list of options + * `options` is a keyword list of options or a `%Cldr.Number.Format.Options{}` struct ## Returns @@ -742,7 +742,7 @@ defmodule Money do * `money` is any valid `Money.t` type returned by `Money.new/2` - * `options` is a keyword list of options + * `options` is a keyword list of options or a `%Cldr.Number.Format.Options{}` struct ## Options @@ -766,7 +766,8 @@ defmodule Money do "1,234 US dollars" """ - @spec to_string!(Money.t(), Keyword.t()) :: String.t() | no_return() + @spec to_string!(Money.t(), Keyword.t() | Cldr.Number.Format.Options.t()) :: + String.t() | no_return() def to_string!(%Money{} = money, options \\ []) do case to_string(money, options) do