Math in Elixir


I am playing around the math function that’s inherited from Erlang and when I run the command


I get the answer in exponential form as


How can I get a plain answer that is


These are the same thing, just displayed differently. So if you want to display it in “regular” notation, then you can format it using :io_lib.format/2. Alternatively if you are sure it will be integer, then you can use trunc/1 to make it into integer.

If that’s not a deal breaker, you can use the Elixir library Decimal.