https://issues.apache.org/bugzilla/show_bug.cgi?id=53389

          Priority: P2
            Bug ID: 53389
          Assignee: [email protected]
           Summary: DataFormatter not removing locale for number cell
          Severity: normal
    Classification: Unclassified
                OS: Windows XP
          Reporter: [email protected]
          Hardware: PC
            Status: NEW
           Version: 3.8
         Component: POI Overall
           Product: POI

The DataFormatter is not removing the locale when given the format string
[$-1010409]General for a number cell. The resulting format String is "General",
but is applied too late.

In org.apache.poi.ss.usermodel.DataFormatter.getFormat(double, int, String), at
the end of the function, createFormat is called. However, if the resulting
format is "General" (or I assume "@" also), the logic a couple lines earlier to
return generalWholeNumFormat or generalDecimalNumFormat does not apply. If the
code were rearranged to apply this check (again?) after createFormat is called,
then a valid format could be used.

For the Junit, org.apache.poi.ss.usermodel.TestDataFormatter, (I stuck it in
testOther), you can add the following to demonstrate this case:

assertEquals("63", dfUS.formatRawCellContents(63.0, -1, "[$-1010409]General"));

I expect "63". The code outputs "General".

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to