From ce940003c8ffe75bb49416115f73fa1180c0b15c Mon Sep 17 00:00:00 2001 From: Kip Cole Date: Tue, 16 Apr 2019 11:55:48 +0900 Subject: [PATCH] Update Money.to_string/2 docs --- lib/money.ex | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/lib/money.ex b/lib/money.ex index df5b9df..dfe8354 100644 --- a/lib/money.ex +++ b/lib/money.ex @@ -575,17 +575,26 @@ defmodule Money do as a currency which applies the appropriate rounding and fractional digits for the currency. - ## Options + ## Arguments - * `money_1` is any valid `Money.t` type returned + * `money` is any valid `Money.t` type returned by `Money.new/2` + * `options` is a keyword list of options + ## Returns * `{:ok, string}` or * `{:error, reason}` + ## Options + + * `:backend` is any CLDR backend module. The default is + `Money.default_backend()`. + + * Any other options are passed to `Cldr.Number.to_string/3` + ## Examples iex> Money.to_string Money.new(:USD, 1234) @@ -609,7 +618,7 @@ defmodule Money do end @doc """ - Returns a formatted string representation of a `Money{}` or raises if + Returns a formatted string representation of a `Money.t` or raises if there is an error. Formatting is performed according to the rules defined by CLDR. See @@ -617,6 +626,20 @@ defmodule Money do as a currency which applies the appropriate rounding and fractional digits for the currency. + ## Arguments + + * `money` is any valid `Money.t` type returned + by `Money.new/2` + + * `options` is a keyword list of options + + ## Options + + * `:backend` is any CLDR backend module. The default is + `Money.default_backend()`. + + * Any other options are passed to `Cldr.Number.to_string/3` + ## Examples iex> Money.to_string! Money.new(:USD, 1234)