Bug 61049 - Incorrect ordering in formats of BuiltinFormats.java
Summary: Incorrect ordering in formats of BuiltinFormats.java
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 3.16-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-27 06:58 UTC by choonbong.shin
Modified: 2017-04-27 16:38 UTC (History)
0 users



Attachments
result in excel and MS Internal Format List (406.55 KB, image/png)
2017-04-27 06:58 UTC, choonbong.shin
Details

Note You need to log in before you can comment on or make changes to this bug.
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.