pjfanning opened a new pull request, #1484: URL: https://github.com/apache/poi/pull/1484
Follow-up to #1483 (#1482). This branch is built on #1483, so its first commit is the #1483 commit; review only the last commit, or merge #1483 first. `DecimalFormat` uses only the positive section's percent signs to set the multiplier, and applies it to negative values too. When the sections have different numbers of `%`, negative values were scaled wrongly: | Format | Value | Before | After (same as `CellFormat`) | |---|---|---|---| | `0%%;-0%` | -0.25 | `-2500%` | `-25%` | | `0%;-0%%` | -0.25 | `-25%%` | `-2500%%` | | `0%;-0` | -5 | `-500` | `-5` | | `0;-0%` | -5 | `-5%` | `-500%` | | `0.0%;(0.0)` | -5 | `(500.0)` | `(5.0)` | When the sections' percent counts differ, the percent signs are quoted. The positive section's multiplier is set on the `DecimalFormat`, and negative values are formatted by a copy that has the negative section's multiplier. `TestDataFormatter` has a new test with the formats above. `TestDataFormatterAgainstExcel` still passes. The workbooks used by that test have no formats like these, so the expected values come from `CellFormat`, which scales each section separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
