SoftBank.Cldr.Money.normalize
You're seeing just the function
normalize
, go back to SoftBank.Cldr.Money module for more information.
Specs
Calls Decimal.reduce/1
on the given :'Elixir.Money'.t()
This will normalize the coefficient and exponent of the
decimal amount in a standard way that may aid in
native comparison of %:'Elixir.Money'.t()
items.
Example
iex> x = %Money{currency: :USD, amount: %Decimal{sign: 1, coef: 42, exp: 0}}
#Money<:USD, 42>
iex> y = %Money{currency: :USD, amount: %Decimal{sign: 1, coef: 4200000000, exp: -8}}
#Money<:USD, 42.00000000>
iex> x == y
false
iex> y = Money.normalize(x)
#Money<:USD, 42>
iex> x == y
true