Money.to_decimal

You're seeing just the function to_decimal, go back to Money module for more information.

Specs

to_decimal(money :: t()) :: Decimal.t()

Returns the amount part of a Money type as a Decimal

Arguments

  • money is any valid Money.t type returned by Money.new/2

Returns

  • a Decimal.t

Example

iex> m = Money.new("USD", 100)
iex> Money.to_decimal(m)
#Decimal<100>