| Summary: | Minus sign mis-placed with format ".00" until save/reload | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Jim Avera <jim.avera> |
| Component: | Calc | Assignee: | Laurent Balland <jumbo4444> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | jumbo4444 |
| Priority: | medium | ||
| Version: | 24.8.0.0 alpha0+ | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | target:25.2.0 target:24.8.0.0.beta2 | ||
| Crash report or crash signature: | Regression By: | ||
| Bug Depends on: | |||
| Bug Blocks: | 107575 | ||
| Attachments: | XLSX file with ".##;-##" format | ||
|
Description
Jim Avera
2024-02-27 21:15:36 UTC
While I can confirm the behavior, I must also say that using ".00;-.00" (without quotes) is not an accepted way to provide a number format. <https://help.libreoffice.org/latest/en-US/text/shared/01/05020301.html> If we use the fields: Decimal places: 2 Leading zeroes: 0 we already get "#.00", as expected. Checking "Negative numbers in red" will give: #.00;[RED]-#.00 from which we can remove the red to obtain: #.00;-#.00 which shows the correct result. Additionally, when entering the proposed ".00;-.00" (and before clicking on OK accepting this format), the preview area (to the right side of the number format dialogue) will show the unwanted "99999-.00". So, I will set this as a new enhancement request, but I would say this has low priority too (I am leaving this as normal; QA members might change it). I think this is a bug because the documentation nowhere mentions that a digit symbol must precede the decimal, and in fact there is an EXAMPLE in the docs of a format without anything before the decimal (although it does not involve negatives). The format string docs are at https://help.libreoffice.org/latest/en-US/text/shared/01/05020301.html?&DbPAR=CALC&System=UNIX The counter-example (sort of) is «.#,, "Million"» at https://help.libreoffice.org/latest/en-US/text/scalc/guide/format_value_userdef.html?DbPAR=CALC#bm_id3143268 FWIW, in the real application I had to hand-type the format string because the Format Cells dialog options do not support what was needed (percentages with different colors for both positive & negative values). I probably omitted any leading '#' in a mistaken attempt to allow the column to be narrower when all values were < 1.00% Created attachment 193579 [details]
XLSX file with ".##;-##" format
The bug appears also when opening an XLSX file containing format:
.##;-.##
Laurent Balland committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/bd2ffb6f33e549483b41f6235ba64fa735205d38 tdf#159930 Treat special case with no integer digit It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Laurent Balland committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/54e46d3425846ed8e5bf84b1bf06ff8cf3aa48ce tdf#159930 Treat special case with no integer digit It will be available in 24.8.0.0.beta2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. |