Decimal.compare produces the wrong result for some cases
vshev4enko opened this issue · comments
Some cases:
iex(41)> Decimal.compare("0.1234", 0)
:lt
not a lot, we use only one number for testing
Our tests lit up with failures after the update. Can confirm the above:
Elixir 1.14.4 (compiled with Erlang/OTP 25)
Decimal 2.1.0
Decimal.lt?
and Decimal.gt?
are also broken, but they seem to rely on compare/2
Closing in favor of #197.
@vshev4enko @wkirschbaum Can you confirm the PR branch works in your applications?
@mzigora @willemodendaal Also CCing you, would appreciate all help in testing this.
yes, works in my applications
@ericmj All previously failed tests on our side passes with the above fix. 200+ tests using Decimal, so fairly confident this works. 😍
Thank you for reporting back! I will do a bugfix release today.