You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2022/02/03 04:45:44 UTC

[Bug 65792] Using the INT function, POI and Micro Excel Calculation results do not match(ver:3.17)

https://bz.apache.org/bugzilla/show_bug.cgi?id=65792

--- Comment #17 from caoxj <ca...@hotmail.com> ---
Thank you very much.
Since the impact is small in a hurry, only INT is supported.

NumericFunction.java

        public static final Function INT = new OneArg() {
                protected double evaluate(double d) {
-                       return Math.round(d-0.5);

+                       if(d > 0){
+                               return MathX.roundDown(d, 0);
+                       }else{
+                               return MathX.roundUp(d, 0);
+                       }
                }
        };

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org