I have the following number format code defined for a cell: [>0]#,##0_);[<0](#,##0);"-"_) This works as expected and when the cell has a zero value a single "-" is displayed followed by the space for a right-hand parenthesis. However when the file is closed and then re-opened the number format code has been replaced with the following: [>0]#,##0_);[<0](#,##0);- "_)" which obviously does not give the desired format for a zero value. Strangely when this number format code is used: [>0]#,##0_);[<0](#,##0);"--"_) no such mangling occurs when the file is closed and re-opened.
Repro in LO Dev 26.8 (2026-02-07). I do believe that Calc modifying the format in the way described in comment 0 is unexpected. I am not completely sure which should be an adequate format in order to obtain the desired result for "zero" values (instead of Calc modifying the custom format to something different). I have not tested positive neither negative values, for 2 reasons: _ these formats are not modified by Calc in unexpected ways; and, _ using comma as either group separator or decimal separator does not affect the current behavior on the format for "zero" values. In the meantime, a workaround (to what the OP is looking for, with the format as expressed on comment 0 ) can be: "[>0]#,##0_);[<0](#,##0);-#_)" (without the initial and final quotation marks) IOW, change '"-"_)' to '-#_)' (without the single nor double quotation marks).
If space is NOT the thousand separator (like for en-US), the format "-"_) is wrongly exported in ODF as <number:text>- _)</number:text> which is correctly rendered as "- _)" If space IS the thousand separator (like for fr-FR), the format "-"_) is almost* correctly exported in ODF as <number:text loext:blank-width-char=")1">- </number:text> which is wrongly rendered as "- _)" * I have no idea what '1' figures out
This regression was introduced in LibO 24.2 branch while resolving tdf#152724
(In reply to Laurent Balland from comment #2) > * I have no idea what '1' figures out '1' is the position in the string, starting at 0. See: https://github.com/LibreOffice/core/commit/74d9da037cac01c5abd768a99b2f948553fbf144