@@ -539,13 +539,13 @@ defmodule Money.Backend do
539539 ## Options
540540
541541 * `money_1` and `money_2` are any valid `t:Money.t/0` types returned
542- by `Money.new/2`
542+ by `Money.new/2`.
543543
544544 ## Returns
545545
546546 * `{:ok, money}` or
547547
548- * `{:error, reason}`
548+ * `{:error, reason}`.
549549
550550 ## Example
551551
@@ -568,7 +568,7 @@ defmodule Money.Backend do
568568 ## Arguments
569569
570570 * `money_1` and `money_2` are any valid `t:Money.t/0` types returned
571- by `Money.new/2`
571+ by `Money.new/2`.
572572
573573 ## Returns
574574
@@ -598,9 +598,9 @@ defmodule Money.Backend do
598598 ## Arguments
599599
600600 * `money` is any valid `t:Money.t/0` type returned
601- by `Money.new/2`
601+ by `Money.new/2`.
602602
603- * `number` is an integer, float or `t:Decimal.t/0`
603+ * `number` is an integer, float or `t:Decimal.t/0`.
604604
605605 > Note that multipling one `t:Money.t/0` by another is not supported.
606606
@@ -632,7 +632,7 @@ defmodule Money.Backend do
632632 ## Arguments
633633
634634 * `money` is any valid `t:Money.t/0` types returned
635- by `Money.new/2`
635+ by `Money.new/2`.
636636
637637 * `number` is an integer, float or `Decimal.t`
638638
@@ -662,10 +662,10 @@ defmodule Money.Backend do
662662
663663 ## Arguments
664664
665- * `money` is any valid `t:Money.t/0` types returned
665+ * `money` is any valid `t:Money.t/0` types returned.
666666 by `Money.new/2`
667667
668- * `number` is an integer, float or `t:Decimal.t/0`
668+ * `number` is an integer, float or `t:Decimal.t/0`.
669669
670670 > Note that dividing one `t:Money.t/0` by another is not supported.
671671
@@ -699,7 +699,7 @@ defmodule Money.Backend do
699699 * `money` is any valid `t:Money.t/0` types returned
700700 by `Money.new/2`
701701
702- * `number` is an integer, float or `Decimal.t`
702+ * `number` is an integer, float or `t: Decimal.t/0 `
703703
704704 ## Returns
705705
@@ -754,13 +754,13 @@ defmodule Money.Backend do
754754 ## Arguments
755755
756756 * `money_1` and `money_2` are any valid `t:Money.t/0` types returned
757- by `Money.new/2`
757+ by `Money.new/2`.
758758
759759 ## Returns
760760
761761 * `:gt` | `:eq` | `:lt` or
762762
763- * `{:error, {module(), String.t}}`
763+ * `{:error, {module(), String.t}}`.
764764
765765 ## Examples
766766
@@ -791,13 +791,13 @@ defmodule Money.Backend do
791791 ## Arguments
792792
793793 * `money_1` and `money_2` are any valid `t:Money.t/0` types returned
794- by `Money.new/2`
794+ by `Money.new/2`.
795795
796796 ## Returns
797797
798798 * `:gt` | `:eq` | `:lt` or
799799
800- * raises an exception
800+ * raises an exception.
801801
802802 ## Examples
803803
@@ -817,7 +817,7 @@ defmodule Money.Backend do
817817 ## Arguments
818818
819819 * `money_1` and `money_2` are any valid `t:Money.t/0` types returned
820- by `Money.new/2`
820+ by `Money.new/2`.
821821
822822 ## Returns
823823
@@ -854,13 +854,13 @@ defmodule Money.Backend do
854854 ## Arguments
855855
856856 * `money_1` and `money_2` are any valid `t:Money.t/0` types returned
857- by `Money.new/2`
857+ by `Money.new/2`.
858858
859859 ## Returns
860860
861861 * `-1` | `0` | `1` or
862862
863- * raises an exception
863+ * raises an exception.
864864
865865 ## Examples
866866
@@ -887,12 +887,12 @@ defmodule Money.Backend do
887887 derived as follows:
888888
889889 1. Round the money amount to the required currency precision using
890- `Money.round/1`
890+ `Money.round/1`.
891891
892- 2. Divide the result of step 1 by the integer divisor
892+ 2. Divide the result of step 1 by the integer divisor.
893893
894894 3. Round the result of the division to the precision of the currency
895- using `Money.round/1`
895+ using `Money.round/1`.
896896
897897 4. Return two numbers: the result of the division and any remainder
898898 that could not be applied given the precision of the currency.
@@ -921,15 +921,15 @@ defmodule Money.Backend do
921921
922922 ## Arguments
923923
924- * `money` is a `` t:Money.t/0`` struct
924+ * `money` is a `t:Money.t/0` struct.
925925
926- * `opts ` is a keyword list of options
926+ * `options ` is a keyword list of options.
927927
928928 ## Options
929929
930930 * `:rounding_mode` that defines how the number will be rounded. See
931931 `Decimal.Context`. The default is `:half_even` which is also known
932- as "banker's rounding"
932+ as "banker's rounding".
933933
934934 * `:currency_digits` which determines the rounding increment.
935935 The valid options are `:cash`, `:accounting` and `:iso` or
@@ -940,13 +940,13 @@ defmodule Money.Backend do
940940
941941 There are two kinds of rounding applied:
942942
943- 1. Round to the appropriate number of fractional digits
943+ 1. Round to the appropriate number of fractional digits.
944944
945945 3. Apply an appropriate rounding increment. Most currencies
946946 round to the same precision as the number of decimal digits, but some
947947 such as `:CHF` round to a minimum such as `0.05` when its a cash
948948 amount. The rounding increment is applied when the option
949- `:currency_digits` is set to `:cash`
949+ `:currency_digits` is set to `:cash`.
950950
951951 ## Examples
952952
@@ -963,7 +963,9 @@ defmodule Money.Backend do
963963 Money.new(:JPY, "124")
964964
965965 """
966- @ spec round ( Elixir.Money . t ( ) , Keyword . t ( ) ) :: Elixir.Money . t ( )
966+ @ spec round ( Elixir.Money . t ( ) , Keyword . t ( ) ) ::
967+ Elixir.Money . t ( ) | { :error , { module ( ) , binary ( ) } }
968+
967969 def round ( % Elixir.Money { } = money , options \\ [ ] ) do
968970 Elixir.Money . round ( money , options )
969971 end
@@ -1266,7 +1268,7 @@ defmodule Money.Backend do
12661268
12671269 """
12681270 @ spec from_integer ( integer , Elixir.Money . currency_code ( ) , Keyword . t ( ) ) ::
1269- Elixir.Money . t ( ) | { :error , module ( ) , String . t ( ) }
1271+ Elixir.Money . t ( ) | { :error , { module ( ) , String . t ( ) } }
12701272
12711273 def from_integer ( amount , currency , options \\ [ ] ) when is_integer ( amount ) do
12721274 Elixir.Money . from_integer ( amount , currency , options )
@@ -1297,7 +1299,7 @@ defmodule Money.Backend do
12971299
12981300 """
12991301 @ spec zero ( Elixir.Money . currency_code ( ) | Elixir.Money . t ( ) , Keyword . t ( ) ) ::
1300- Elixir.Money . t ( )
1302+ Elixir.Money . t ( ) | { :error , { module ( ) , binary ( ) } }
13011303
13021304 def zero ( money , options \\ [ ] )
13031305
0 commit comments