Bug 169583 - Issue with user-defined number format when the number is negative
Summary: Issue with user-defined number format when the number is negative
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
25.8.3.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-20 22:55 UTC by David García
Modified: 2026-01-29 10:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Calc document (51.06 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-11-20 22:56 UTC, David García
Details
Screenshot (44.43 KB, image/png)
2025-11-20 22:57 UTC, David García
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David García 2025-11-20 22:55:59 UTC
Description:
I intented to create a user-defined number format consisting of a symbol and a number with two decimals, so I typed this:

"▼ "0,00

It seemed to work, until, when the number became negative, it displayed this:

-▼ 18,67

As you can see, the minus sign appears not attached to the number, but at the beginning of the string.

I wasn't sure if I was missing something and whether, somehow, this could be expected behaviour, so I tried to Google the question and I found this solution:

"▼ "+0,00;"▼ "-0,00;"▼ "0,00

Which I turned into this, as the plus sign was unnecesary to me:

"▼ "0,00;"▼ "-0,00;"▼ "0,00

I was going to leave there, as it worked for me, but the more I saw it, the more I found this solution far from intuitive for a regular user and certainly for me.

Therefore, I still believe the minus sign should be attached to the number, as it's part of the number.

Steps to Reproduce:
1. You create a user-defined number format such as:

"▼ "0,00

2. You make sure the number it takes is negative.

Actual Results:
When the number is negative, the minus sign appears at the beginning of the string:

-▼ 18,67

Expected Results:
When the number is negative, the minus sign should be attached to the number, as it's part of the number:

▼ -18,67


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.8.3.2 (X86_64)
Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e
CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Comment 1 David García 2025-11-20 22:56:47 UTC
Created attachment 204151 [details]
Calc document
Comment 2 David García 2025-11-20 22:57:04 UTC
Created attachment 204152 [details]
Screenshot
Comment 3 Robert Großkopf 2025-11-21 12:18:22 UTC
Try 
"▲ "0,00;"▲ "-0,00

Have a look at the content for currency symbols. Seems to be the leading symbol would be placed between minus sign and following number:
[$£-809]#.##0,00;[RED]-[$£-809]#.##0,00
Comment 4 David García 2025-11-22 09:50:41 UTC
Hi, Robert!

Thank you for your reply. I hadn't thought about currencies. I understand that, in this case scenario, the negative sign should probably be at the front:

-£12,30

However:

1. My user-defined format remains under the 'number' category and isn't (and shouldn't be) taken as a currency.

2. If a sign corresponds to a particular currency (such as £), I can understand that Calc decides to convert the format from number into currency, but in those cases where a sign doesn't represent a particulary currency, I still believe that the right order should be this:

▼ -18,67

Otherwise, I'll be using your suggestion (after omitting the plus sign in one of the conditions, it's true that the last one became redundant):

▲ "0,00;"▲ "-0,00
Comment 5 Mike Kaganski 2026-01-29 09:46:18 UTC
Even though you may consider one or the other way "more correct", it is just a matter of specification.

And since changing this will break countless of existing documents, which would already take the current behavior into account, this is WONTFIX.

The only thing that may be considered here is turning this into a documentation issue, where https://help.libreoffice.org/latest/en-US/text/shared/01/05020301.html could be possibly amended to explicitly mention how the minus is attached relative to possible literal prefix string.
Comment 6 Mike Kaganski 2026-01-29 10:28:36 UTC
One important data point to take into account for the WONTFIX: the current behavior matches other spreadsheet software format strings implementation: Excel, Google Sheets, Gnumeric. Implementing the proposal here would make our format string inconsistent with the industry informal standard.