Bug 61049

Summary: Incorrect ordering in formats of BuiltinFormats.java
Product: POI Reporter: choonbong.shin <intel2>
Component: SS CommonAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.16-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: result in excel and MS Internal Format List

Description choonbong.shin 2017-04-27 06:58:40 UTC
Created attachment 34960 [details]
result in excel and MS Internal Format List

Hi.

I used poi library(ver 3.12) to create xls file. And I've found a bug.

I noticed that when a xls file is created using POI, the default style for the button "Comma Style" results in the format which includes the currency symbol("$").

Checking the source(in file BuiltinFormats.java), where internal formats are defined, I found the following,

putFormat(m, 0x29, "_(\"$\"* #,##0_);_(\"$\"* (#,##0);_(\"$\"* \"-\"_);_(@_)");
putFormat(m, 0x2a, "_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)");

But in excel's internal format list, two entries are

0x29      _(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)
0x2a      _($* #,##0_);_($*(#,##0);_($* "-"_);_(@_)

Even in comments of BuiltinFormats.java, there are

 *       0x29, "_(* #,##0_);_(* (#,##0);_(* \"-\"_);_(@_)"<br/>
 *       0x2a, "_($* #,##0_);_($* (#,##0);_($* \"-\"_);_(@_)"<br/>

So you have to fix this part.


* ps : It is same in 3.16.
Comment 1 Tim Allison 2017-04-27 15:36:12 UTC
Thank you for raising this.  Will fix shortly.
Comment 2 Tim Allison 2017-04-27 16:38:11 UTC
r1792918


Thank you, again, for raising this.  Let us know if you find anything else.