poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 55731] The character repeation format character * isn't stripped
Date Fri, 01 Nov 2013 17:53:59 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=55731

--- Comment #1 from Eric Peters <eric@peters.org> ---
Here's some additional debug information: 


Basically,
DataFormatter.cleanFormatForNumber("$"* #,##0.00_);_("$"* (#,##0.00)) =>
$#,##0.00;$(#,##0.00)

strips the *<space>

But
DataFormatter.cleanFormatForNumber((_(* #,##0.00_);_(* (#,##0.00)) => *
#,##0.00;* (#,##0.00)

Doesn't & java.text.DecimalFormat will just reprint the *<space> out:
scala> val format = new java.text.DecimalFormat("* #,##0.00;* (#,##0.00)")
format: java.text.DecimalFormat = java.text.DecimalFormat@67a12

scala> format.format(4.79d)
res2: String = * 4.79



A psuedo stack trace/debug statements:


10:51:36.477 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter - Enter
DataFormatter.getFormat(4.79, 43, _(* #,##0.00_);_(* (#,##0.00);_(*
"-"??_);_(@_))
10:51:36.477 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter -
DataFormatter.getFormat(4.79, +43, _(* #,##0.00_);_(* (#,##0.00);_(*
"-"??_);_(@_)), Target formatStr: _(* #,##0.00_);_(* (#,##0.00)
10:51:36.477 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter - Enter
DataFormatter.createFormat(4.79, +43, _(* #,##0.00_);_(* (#,##0.00))
10:51:36.477 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter - Enter
DataFormatter.createNumberFormat(_(* #,##0.00_);_(* (#,##0.00), +4.79)
10:51:36.477 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter -
DataFormatter.createNumberFormat(_(* #,##0.00_);_(* (#,##0.00), +4.79):
cleanFormatForNumber(formatStr) => * #,##0.00;* (#,##0.00)
10:51:36.482 [main] TRACE fm.flatfile.excel.XLSStreamProcessor - ok numrec:
[NUMBER]
    .row    = 0x0000
    .col    = 0x0000
    .xfindex= 0x003E
  .value= 4.79
[/NUMBER]
 and formatListener.getFormatIndex(numrec): 43,
formatListener.getFormatString(43): _(* #,##0.00_);_(* (#,##0.00);_(*
"-"??_);_(@_), HSSFDataFormat.getBuiltinFormat(43): _(* #,##0.00_);_(*
(#,##0.00);_(* "-"??_);_(@_), formatListener.formatNumberDateCell(numrec): *
4.79





10:51:36.483 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter - Enter
DataFormatter.getFormat(4.79, 43, _(* #,##0.00_);_(* (#,##0.00);_(*
"-"??_);_(@_))
10:51:36.483 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter -
DataFormatter.getFormat(4.79, +43, _(* #,##0.00_);_(* (#,##0.00);_(*
"-"??_);_(@_)), Target formatStr: _(* #,##0.00_);_(* (#,##0.00)
10:51:36.484 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter - Enter
DataFormatter.getFormat(5.79, 44, _("$"* #,##0.00_);_("$"* (#,##0.00);_("$"*
"-"??_);_(@_))
10:51:36.484 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter -
DataFormatter.getFormat(5.79, +44, _("$"* #,##0.00_);_("$"* (#,##0.00);_("$"*
"-"??_);_(@_)), Target formatStr: _("$"* #,##0.00_);_("$"* (#,##0.00)
10:51:36.484 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter - Enter
DataFormatter.createFormat(5.79, +44, _("$"* #,##0.00_);_("$"* (#,##0.00))
10:51:36.484 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter - Enter
DataFormatter.createNumberFormat(_("$"* #,##0.00_);_("$"* (#,##0.00), +5.79)
10:51:36.485 [main] DEBUG o.a.poi.ss.usermodel.DataFormatter -
DataFormatter.createNumberFormat(_("$"* #,##0.00_);_("$"* (#,##0.00), +5.79):
cleanFormatForNumber(formatStr) => $#,##0.00;$(#,##0.00)
10:51:36.485 [main] TRACE fm.flatfile.excel.XLSStreamProcessor - ok numrec:
[NUMBER]
    .row    = 0x0000
    .col    = 0x0001
    .xfindex= 0x003F
  .value= 5.79
[/NUMBER]
 and formatListener.getFormatIndex(numrec): 44,
formatListener.getFormatString(44): _("$"* #,##0.00_);_("$"* (#,##0.00);_("$"*
"-"??_);_(@_), HSSFDataFormat.getBuiltinFormat(44): _("$"* #,##0.00_);_("$"*
(#,##0.00);_("$"* "-"??_);_(@_), formatListener.formatNumberDateCell(numrec):
$5.79




scala> val format = new java.text.DecimalFormat("* #,##0.00;* (#,##0.00)")
format: java.text.DecimalFormat = java.text.DecimalFormat@67a12

scala> format.format(4.79d)
res2: String = * 4.79

scala> 

scala> val format = new java.text.DecimalFormat("$#,##0.00;$(#,##0.00")
format: java.text.DecimalFormat = java.text.DecimalFormat@67500

scala> format.format(5.79d)
res3: String = $5.79

scala>

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message