pjfanning opened a new pull request, #1426: URL: https://github.com/apache/poi/pull/1426
When a number format has quoted or escaped text after trailing scaling commas, `hasLiteralBetweenDigits()` returned `false` and the format went to `DecimalFormat`: | value | format | before | after (= Excel) | |---|---|---|---| | 1234567 | `0.0,"万"` | `1234567` (fallback) | `1234.6万` | | 1234567 | `#,##0,,"M"` | `1234567` (fallback) | `1M` | | 1234567 | `#,##0.0,","` | `1.2` (quoted comma scaled again) | `1,234.6,` | The check, now `hasLiteralDecimalFormatCannotShow()`, also sends a section to `CellFormat` when quoted or escaped text follows a comma with no digit placeholder after it. Grouping commas such as `#,##0" units"` still use `DecimalFormat`. Found in review of apache/fesod#1232 (https://github.com/apache/fesod/pull/1232#discussion_r4301516612), which ports POI's DataFormatter code; the new test cases come from that PR. Tests: `TestDataFormatter` (new `testFormatWithLiteralAfterTrailingCommas`), `TestText`, `TestHSSFDataFormat`, `TestCellFormat` pass. 🤖 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]
