-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in testLog10() #9
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I implemented this expression evaluator back in April of 2024 and deployed it to our production environment.
The tests obviously passed at the time, because it deployed everywhere successfully.
Today, I have been receiving assert failures though for testLog10() in all of our dev sanboxes.
Every Sandbox I have tested on is on Winter '25.
Production is still on Sumer '24 and is not receiving assert failures.
Reviewing the code of the evaluator, I noticed that the eval() method does a
return res.stripTrailingZeros();
which should obviously strips trailing 0s.We do have the following SF Issue: https://issues.salesforce.com/issue/a028c00000gAwdUAAS/decimalstriptrailingzeros-doesnt-strip-off-expected-trailing-zeros-for-values-like-00-or-000-etc
This SF Issue indicates inconsistent behavior with values such as 0.0 or 0.00. If you use
stripTrailingZeros()
, you can get 0.0 and 0.00 still. The issue indicates that it is still in review, but it looks like Winter '25 may have resolved it.I think the correct solution here is to update the tests that Assert on 0.0 to Assert on 0 now.
Easy enough fix locally, but wanted it pointed out here for the library as well.
The text was updated successfully, but these errors were encountered: