[Issue] Percentage field losing formatting

Discuss the word processor
Post Reply
A.Fish
Posts: 15
Joined: Wed Aug 21, 2019 7:37 pm

[Issue] Percentage field losing formatting

Post by A.Fish »

Not sure if this is a bug or if I'm just missing something.

I am attempting to format a field that holds a percentage value, and I want it to display between 2 & 4 places to the right of the decimal point, depending on whether or not the last two places are needed. So for example, if the field value is .10 then the field will display as 10.00%, but if I enter .107433 then the field will display as 10.7433%

I Have attempted to accomplish this by editing the field format code to be 0.00##%, which initially works as expected.

The problem arises when attempting to open/use the same document at a later time, at which time the field has lost it's formatting and reverts to displaying all 4 places after the decimal - ie. 10.0000%. As clarification, the file is saved with the desired field format before closing, and works as expected prior to closing the document, but when opening up the saved document, the field format has reset and does not display as desired.

I can't figure out why it keeps doing this, I have other documents wherein the field saves and displays as expected, but I can't figure out what the difference between the documents are that would cause this.

Has anyone else experienced this or aware of a fix short of re-creating the entire document?

Thanks,
A Fish
Last edited by MrProgrammer on Tue Jun 16, 2026 9:42 pm, edited 1 time in total.
Reason: Tag topic as known issue
Windows 10 Pro
OpenOffice 4.1.15
User avatar
robleyd
Moderator
Posts: 5520
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Percentage field losing formatting

Post by robleyd »

Are you saving the document as .odt, or some other format?
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2..2; SlackBuild for 26.2.4 by Eric Hameleers
-----------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
A.Fish
Posts: 15
Joined: Wed Aug 21, 2019 7:37 pm

Re: Percentage field losing formatting

Post by A.Fish »

robleyd wrote: Wed Jun 10, 2026 2:47 am Are you saving the document as .odt, or some other format?
It is saved as a .odt file.
Windows 10 Pro
OpenOffice 4.1.15
User avatar
robleyd
Moderator
Posts: 5520
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Percentage field losing formatting

Post by robleyd »

Can you provide a small sample file that demonstrates the problem?
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2..2; SlackBuild for 26.2.4 by Eric Hameleers
-----------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
User avatar
MrProgrammer
Moderator
Posts: 5445
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Percentage field losing formatting

Post by MrProgrammer »

A.Fish wrote: Tue Jun 09, 2026 4:39 pm I have attempted to accomplish this by editing the field format code to be 0.00##%, which initially works as expected. The problem arises when attempting to open/use the same document at a later time, at which time the field has lost it's formatting ….
[Solved] Cell format changing on Save

If this solved your problem please go to your first post use the Edit ✏️ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
A.Fish
Posts: 15
Joined: Wed Aug 21, 2019 7:37 pm

Re: Percentage field losing formatting

Post by A.Fish »

MrProgrammer wrote: Wed Jun 10, 2026 3:31 pm
[Solved] Cell format changing on Save

If this solved your problem please go to your first post use the Edit ✏️ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
While I am attempting to do this in Writer rather than Calc, am I correct in my interpretation that this is a missing feature and can't be done? As the post you cited is from 14 years ago, I'm assuming the likelihood of that being added/fixed is not good. Such a shame if that's the case as it would seem a fairly basic feature.

I swore that I had been able to save some documents with the desired formatting being retained, but now that I am going back through my previous documents, nothing seems to have the desired format any longer, so either something changed, I misremembered, or (and this seems the most likely) I'm obviously in the matrix... :lol:

Very disappointing, but I guess I just have to deal with the additional decimal places.

Thanks for the replies.
Windows 10 Pro
OpenOffice 4.1.15
User avatar
MrProgrammer
Moderator
Posts: 5445
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Percentage field losing formatting

Post by MrProgrammer »

A.Fish wrote: Wed Jun 10, 2026 4:23 pm I am attempting to do this in Writer rather than Calc …
The ODF standard applies to all of the OpenOffice components, including Writer and Calc. This specification describes how OpenOffice documents are stored in the files created during the Save operation. The standard is important because it allows any developer to understand the content of OpenOffice documents.

A.Fish wrote: Wed Jun 10, 2026 4:23 pm As the post you cited is from 14 years ago, I'm assuming the likelihood of that being added/fixed is not good.
I do not claim to be an expert in the complex ODF standard, however my interpretation is that adding the feature you want would require a change to the ODF standard, because an ODT document has no way to save your 0.00##% format while following the currently allowed document structure. Getting an OpenOffice standard changed is a very big deal. Given the current standard, there is nothing to fix.

A.Fish wrote: Tue Jun 09, 2026 4:39 pm Not sure if this is a bug or if I'm just missing something.
There is no bug; OpenOffice is following the specification and working as designed.

If this solved your problem please go to your first post use the Edit ✏️ button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
A.Fish
Posts: 15
Joined: Wed Aug 21, 2019 7:37 pm

Re: Percentage field losing formatting

Post by A.Fish »

Yes I now understand it's technically not a bug and everything is operating as designed. Still disappointing that this doesn't seem to be a feature, but I understand it's not as easy as saying 'do this' and that there would need to be some serious changes under the hood.

I believe I was in part confused because as a user I was allowed to modify the field format in the document, and so would expect whatever format I used for that field to be saved within that document. (and my apparent misremembering of some documents being saved as expected while others were not didn't help) But I understand that it's likely this functionality was not specifically in mind when the standards were initially set up and programmed.

Do you know if LibreOffice uses the same standards and functions in the same way? Or would that save documents with the additional decimal places in fields intact? I know LibreOffice & OpenOffice are 'related' (I believe LibreOffice branched off of OpenOffice?), but not sure of all the differences or how far back they go.
Windows 10 Pro
OpenOffice 4.1.15
User avatar
robleyd
Moderator
Posts: 5520
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Percentage field losing formatting

Post by robleyd »

Using LibreOffice 26.2.4.2 I created both a spreadsheet and a Writer document with a simple table and applied the cell formatting 0.00##% to both. In both cases numbers with two or less decimals displayed with two decimal places, and numbers with three displayed as three.

In both cases, saving and re-opening the files preserved the formatting. Note that the documents were saved as ODF version 1.2 extended, the same as used by OpenOffice.
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2..2; SlackBuild for 26.2.4 by Eric Hameleers
-----------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
cwolan
Posts: 215
Joined: Sun Feb 07, 2021 3:44 pm

Re: Percentage field losing formatting

Post by cwolan »

OpenOffice:
Issue 126973 ("writer table currency number format # suffix saved as 0").
The bug report mentions Issue 126827 with Calc ("breaks custom cell number format in ods after save"). One can also consider Issue 121741 ("Number formats with 0's followed by #'s after the decimal revert to all 0's after reload of document.").

LibreOffice:
It seems that the fixes started with LibreOffice 5.0 (tdf#90133 etc.). From the Release Notes: Scientific Format and Number Format
  • Allow variable decimal with format 0.0##E+00 for scientific numbers and 0.0## for numbers (decimal part can contain some 0 and then some #). This format is now correctly saved in ODF files. tdf#90133
Attachments
Issue 126973.pdf
(117.68 KiB) Downloaded 11 times
OpenOffice 1.1.5 – 4.1.16
LibreOffice 3.3.0.4 – 26.2
Windows 7,10,11 64-bit
A.Fish
Posts: 15
Joined: Wed Aug 21, 2019 7:37 pm

Re: Percentage field losing formatting

Post by A.Fish »

To clarify, (and apologies for not being more concise to begin with) I am not using a table, I am using a variable - a 'User Field' under the ctr + F2 menu. Not sure if this makes a difference but I'm realizing I was using a term that could be confusing and should have been more clear on that.
Windows 10 Pro
OpenOffice 4.1.15
Post Reply