Summary: | [PATCH] Format numbers more like Excel | ||
---|---|---|---|
Product: | POI | Reporter: | Chris Boyle <cmb-apache> |
Component: | SS Common | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: |
Patch to format numbers more like Excel
Format numbers more like Excel does, v2 |
Description
Chris Boyle
2015-10-02 10:57:16 UTC
I've belatedly noticed that POI does already use HALF_UP in at least some circumstances, but I think the rest stands. Hold fire on this, my forward-port and tidying-up missed that test methods now need the @Test annotation, so TestDataFormatter.testLargeNumbersAndENotation() will not actually get run in the currently attached patch, and it fails. I will supply a replacement patch shortly. Created attachment 33165 [details]
Format numbers more like Excel does, v2
Replacement patch attached. Compared to the previous patch, it:
* Adds @Test so the new test actually gets run.
* Chooses better test decimals that are representable as ending in 5 as intended not 49999[...].
* Adds missing invocation of DataFormatter.setExcelStyleRoundingMode() on the new formatter's child DecimalFormats.
|