Created
August 13, 2016 01:13
-
-
Save cayblood/df37616a9dd1f11e6e7f9583769c1eed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iex(1)> alias Decimal, as: D | |
Decimal | |
iex(2)> D.set_context(%D.Context{D.get_context | precision: 2}) | |
:ok | |
iex(3)> D.new("15.620000") | |
#Decimal<15.620000> | |
iex(4)> D.round(D.new("15.620000"), 2) | |
#Decimal<16> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like this to return
#Decimal<15.62>
.