Skip to content

Commit

Permalink
Use Cldr.Macros.doc_since
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Jan 27, 2020
1 parent 0ca0b15 commit 03fadfb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/money.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ defmodule Money do
"""

import Kernel, except: [round: 1, abs: 1]
require Cldr.Macros

@typedoc """
Money is composed of an atom representation of an ISO4217 currency code and
Expand Down Expand Up @@ -314,7 +315,7 @@ defmodule Money do
"Reduce the precision or call Money.new/2 with a Decimal or String amount"}}
"""
# @doc since: "2.0.0"
Cldr.Macros.doc_since "2.0.0"
@max_precision_allowed 15
@spec from_float(float | currency_code, float | currency_code) ::
Money.t() | {:error, {module(), String.t()}}
Expand Down Expand Up @@ -364,7 +365,7 @@ defmodule Money do
(ex_money) lib/money.ex:293: Money.from_float!/2
"""
# @doc since: "2.0.0"
Cldr.Macros.doc_since "2.0.0"
@spec from_float!(currency_code, float) :: Money.t() | no_return()

def from_float!(currency_code, amount) do
Expand Down Expand Up @@ -491,7 +492,7 @@ defmodule Money do
{:error, {Money.ParseError, "Could not parse \\"USD 100 with trailing text\\"."}}
"""
# @doc since: "3.2.0"
Cldr.Macros.doc_since "3.2.0"
@spec parse(String.t(), Keyword.t()) :: Money.t() | {:error, {module(), String.t()}}

def parse(string, options \\ []) do
Expand Down Expand Up @@ -1724,7 +1725,7 @@ defmodule Money do
"""
@spec normalize(Money.t()) :: Money.t()
# @doc since: "5.0.0"
Cldr.Macros.doc_since "5.0.0"
if Code.ensure_loaded?(Decimal) and function_exported?(Decimal, :normalize, 1) do
def normalize(%Money{currency: currency, amount: amount}) do
%Money{currency: currency, amount: Decimal.normalize(amount)}
Expand Down

0 comments on commit 03fadfb

Please sign in to comment.