You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds two numbers together.
The numbers can be integers, floats or Decimals.
The type of the return will be Decimal if the
either of the arguments is a Decimal.
If both arguments are integers, the result will
be an integer. If either of the arguments is a float,
the result will be a float.
Is there any reason those calls to Cldr.Math.maybe_integer() are required?
If not how do you want to proceed to remove them (I could make a pull request)?
In any case thanks for that library it already saved me so much time and headaches 🙏.
The text was updated successfully, but these errors were encountered:
Hello,
There seems to be an issue when using the math functions with Decimal values.
Here is a quick example to illustrate the problem:
In that case I would expect the value to be
Decimal.new("44")
.It seems to work fine if I introduce a float:
I've narrowed the origin of the problem to that call to
Cldr.Math.maybe_integer()
on every math operations.I would expect the returns value to be a
Decimal
if I follow the logic fromcldr_utils
math functions documentation:Is there any reason those calls to
Cldr.Math.maybe_integer()
are required?If not how do you want to proceed to remove them (I could make a pull request)?
In any case thanks for that library it already saved me so much time and headaches 🙏.
The text was updated successfully, but these errors were encountered: