Bug 57003 - [patch] Implement FIXED function
Summary: [patch] Implement FIXED function
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
Keywords: PatchAvailable
Depends on:
Reported: 2014-09-22 15:24 UTC by Patrick Böker
Modified: 2014-11-07 12:30 UTC (History)
0 users

FIXED.diff - the patch (14.67 KB, text/plain)
2014-09-22 15:24 UTC, Patrick Böker
fixed.diff - patch with XLS based test (620.32 KB, patch)
2014-11-04 10:28 UTC, Patrick Böker
Details | Diff
FixedFunctionTestCaseData.xls (29.00 KB, application/octet-stream)
2014-11-04 10:32 UTC, Patrick Böker
fixed.diff - patch with XLS based test (unborked) (14.75 KB, patch)
2014-11-07 10:29 UTC, Patrick Böker
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Böker 2014-09-22 15:24:48 UTC
Created attachment 32042 [details]
FIXED.diff - the patch

- Add an implementation for the FIXED function including tests.
- Correct a typo.
- Cosmetic: Remove "nonexistent gaps" in function array.

The implementation is currently hard-wired to the US way of formatting numbers, e.g. 1,234.56 As far as I know this is true for the rest of POI also at the moment.
Comment 1 Patrick Böker 2014-09-22 15:47:20 UTC
I don't know where the information in functionMetadata.txt comes from, but in Excel 2013 and Excel 2003 the FIXED function takes 1-3 arguments. I took the best guess I had and changed the FIXED spec in BIFF4 and left the one in BIFF2 untouched. I don't know if this is correct nor how to verify this.
Comment 2 Dominik Stadler 2014-10-20 20:14:34 UTC
It would be good to have sample workbooks from those Excel versions to verify that it works correctly with the different behavior in those versions.
Comment 3 Patrick Böker 2014-11-04 10:28:33 UTC
Created attachment 32186 [details]
fixed.diff - patch with XLS based test
Comment 4 Patrick Böker 2014-11-04 10:32:50 UTC
Created attachment 32187 [details]

This is the XLS file needed for the patch. Place it in /test-data/spreadsheet/
I viewed this XLS file in Excel 2003 and Excel 2013 and in both it looks correct.
Comment 5 Patrick Böker 2014-11-04 10:35:52 UTC
The added XLS file shows the expected values in both Excel 2003 and Excel 2013. I don't have any other Excel Versions available to see. If someone else does, feel free to have a look.
Comment 6 Dominik Stadler 2014-11-04 16:20:55 UTC
The new patch contains many more changes, looks like changes done to trunk lately are somehow included in your patch, can you roll it once more with an up-to-date working copy?
Comment 7 Patrick Böker 2014-11-07 10:29:59 UTC
Created attachment 32194 [details]
fixed.diff - patch with XLS based test (unborked)

Recreated the diff. This time only my own changes are included.
As before, the xls file needs to be included manually under test-data/spreadsheet/FixedFunctionTestCaseData.xls
Comment 8 Patrick Böker 2014-11-07 10:30:24 UTC
Corrected patch provided.
Comment 9 Dominik Stadler 2014-11-07 12:30:12 UTC
Thanks, this is applied now via r1637361 in time for 3.11beta3, I reported a bug for OpenOffice to discuss the difference in required parameters at https://issues.apache.org/ooo/show_bug.cgi?id=125837