Skip to content

Commit

Permalink
Update Money.to_string/2 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Apr 16, 2019
1 parent 89133eb commit ce94000
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions lib/money.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -609,14 +618,28 @@ 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
`Cldr.Number.to_string!/2` for formatting options. The default is to format
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)
Expand Down

0 comments on commit ce94000

Please sign in to comment.