Similar to the patch provided in Bug 56315 the ROUNDDOWN() function is not behaving like excel and required a similar patch as for the ROUND() function. New code public static double roundDown(double n, int p) { double retval; if (Double.isNaN(n) || Double.isInfinite(n)) { retval = Double.NaN; } else { retval = new BigDecimal(NumberToTextConverter.toText(n)).setScale(p, java.math.RoundingMode.DOWN).doubleValue(); } return retval; } I will provide a patch, unit tests and integration test FormulaEvalTestData.xls soon
Created attachment 31829 [details] Patch.txt
Created attachment 31830 [details] test-data/spreadsheet/FormulaEvalTestData.xls Integration test
this patch break the ROUNDDOWN method in "some" cases and should not be merged! Patch require further analysis BTW the rounddup function also do not behave in POI like in excel and will hopefully be solved soon.
There were some changes to the methods in the meantime, so I think this is mostly fixed now, if not, then please reopen this bug with updated information. The latest fix was applied via r1801798: github #43: fix roundUp and roundDown. Thanks to @FishMeat on github for the patch.