DarkMatter.Decimals.to_number

You're seeing just the function to_number, go back to DarkMatter.Decimals module for more information.

Specs

Rounds an x of type DarkMatter.numeric/0 into a integer/0.

Examples

iex> to_number(0.11)
0.11

iex> to_number(%Decimal{coef: 124_225, exp: -3})
124.225

iex> to_number("$0")
0

iex> to_number(nil)
nil

iex> to_number("xyz")
nil