Bug 52708 - [PATCH] Patch to CellFormat and related classes
Summary: [PATCH] Patch to CellFormat and related classes
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.8-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2012-02-19 15:26 UTC by Steve Vysny
Modified: 2012-02-27 09:28 UTC (History)
0 users

Patch svn diff (45.70 KB, text/plain)
2012-02-19 15:26 UTC, Steve Vysny

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Vysny 2012-02-19 15:26:23 UTC
Created attachment 28354 [details]
Patch svn diff

Attached patch fixes CellFormat (and related classes) so that the result of CellFormat.apply(cell).text is the same as Excel for the following cases:

- negative numbers and formats with a single format section
- formats with multiple sections (and conditions)
- General/@ format for numbers
- boolean TRUE and FALSE returned in uppercase

(As an aside, my rationale for using CellFormat is that it does some things correctly that DataFormatter doesn't support e.g. scaling commas, quoted/escaped text in the format. I'm finding it easier to create patches for CellFormat than for DataFormatter, and I agree with the comment on my previous patch (issue 54328) that CellFormat and DataFormatter should be merged in the longer term.)
Comment 1 Yegor Kozlov 2012-02-27 09:28:18 UTC
Applied in r1294072

I fully agree that CellFormat and DataFormatter should be merged in the
longer term and current divergence is not good.  I expect that someone will re-visit this code in the future.