Bug 52708

Summary: [PATCH] Patch to CellFormat and related classes
Product: POI Reporter: Steve Vysny <steve.vysny>
Component: POI OverallAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 3.8-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Patch svn diff

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.