Bug 96723 - FILESAVE: custom cell number format with embedded text in decimal part not saved in ods
Summary: FILESAVE: custom cell number format with embedded text in decimal part not sa...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low enhancement
Assignee: Laurent Balland
URL:
Whiteboard: target:7.4.0.2
Keywords:
: 149428 (view as bug list)
Depends on:
Blocks: Number-Format
  Show dependency treegraph
 
Reported: 2015-12-25 15:00 UTC by Falcon
Modified: 2022-07-18 11:47 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
pic with steps and result (78.59 KB, image/png)
2015-12-25 15:00 UTC, Falcon
Details
Sample case (8.37 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2022-07-02 09:32 UTC, Laurent Balland
Details
Update sample case (8.36 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2022-07-02 14:13 UTC, Laurent Balland
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Falcon 2015-12-25 15:00:04 UTC
Created attachment 121545 [details]
pic with steps and result

Create custom number format for cell like: 0"A"0"B"0"C"0"D"."E"0"F"0"G"00"L"

(in my case decimal separator = ",") and save document as ODS. 
When close Cals and open this document cell format is breaks and now it like: 
0"A"0"B"0"C"0.0000"DEFGL".

When unpack document in styles.xml you can see next:
<number:number-style style:name="N106">
<number:number number:decimal-places="4" number:min-integer-digits="4">
<number:embedded-text number:position="3">A</number:embedded-text>
<number:embedded-text number:position="2">B</number:embedded-text>
<number:embedded-text number:position="1">C</number:embedded-text>
</number:number>
<number:text>DEFGL</number:text>
</number:number-style>

For xlsx saving is ok.

Repeatable: Debian 8.2 with LibreOffice 4.3.3.2 and windows 8.1 with LibreOffice 5.0.3.2
Comment 1 A (Andy) 2015-12-26 15:05:14 UTC
Reproducible with LO 5.1.0.1, Win 8.1

ods: I see the same as in the attachment
xlsx: Also not ok, because the new format is not at all saved
Comment 2 Falcon 2016-02-06 16:53:51 UTC
I check in OpenOffice 4.1.2 (last stable) - this bug is not reproducible! 

I think need code synchronization between OpenOffice and LibreOffice.
Comment 3 Falcon 2016-02-07 13:04:38 UTC
(In reply to Falcon from comment #2)
> I check in OpenOffice 4.1.2 (last stable) - this bug is not reproducible! 
> 
> I think need code synchronization between OpenOffice and LibreOffice.

Sorry, i recheck in OpenOffice 4.1.2 - this bug also reproducible. In first time i add wrong format like "A.B" (wrong quote position - decimal separator between quotes).
Comment 4 Eike Rathke 2016-02-17 12:34:03 UTC
These interspersed literals between decimals aren't defined in ODF.
Out of curiosity: is there any actual use case for such format or is it just some "hey let's find something unsupported"?
Comment 5 Laurent Balland 2022-06-12 20:27:17 UTC
*** Bug 149428 has been marked as a duplicate of this bug. ***
Comment 6 Laurent Balland 2022-07-02 09:32:53 UTC
Created attachment 181081 [details]
Sample case

A use case could to improve readability of decimal part with many digits, introducing something equivalent as thousand separator, but for decimal part. 

This sample file contains a format
#,##0.000" "###" "###
(with USA locale)
for 6543210.12345678 it should give
6,543,210.123 456 78
LO applies this format correctly, but "save to ODF and reload" gives format
#,##0.000######"  "
(embedded text in decimal part is moved to right of number), which is represented as:
6,543,210.12345678
Comment 7 Laurent Balland 2022-07-02 14:13:23 UTC
Created attachment 181090 [details]
Update sample case
Comment 8 Commit Notification 2022-07-12 16:02:46 UTC
Laurent BP committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/56dff7b244fb0ef28951193a410dd5c4a3126590

tdf#96723 Number format: embedded text in decimal

It will be available in 7.5.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.
Comment 9 r435g391b823-comp176456@yahoo.com.au 2022-07-14 05:25:35 UTC
Just downloaded and tested LibreOfficeDev_7.5.0.0.alpha0_Win_x86-64.msi from

https://dev-builds.libreoffice.org/daily/master/Win-x86_64@tb77-TDF/2022-07-14_05.05.47/LibreOfficeDev_7.5.0.0.alpha0_Win_x86-64.msi

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: fc8b757dad5d98f4ba1cd40d03505873128670cd
CPU threads: 12; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: en-AU (en_AU); UI: en-US
Calc: threaded

Tested the formats: 0.0000-0000-00   and 0.0000 0000 00   in cells within an .ods file.

The formatting was successfully saved after closing/reopening the .ods, both  after saving then Filemenu->Reload and after saving the file, closing/reopening calc and opening the file again.

Formatting is saved as 0.0000"-"0000"-"00   and 0.0000" "0000" "00   respectively. 

Number formatting after the decimal point is now retained as needed/expected. This is extremely useful for those of us needing enhanced readability of very long decimal numbers.

A very big thank you to Laurent BP for fixing this and everyone else who's contributed too, thank you!

BTW Can I just use this alpha version of libreoffice or is possibly unstable somehow and recommend I wait until a proper stable release?
Comment 10 Eike Rathke 2022-07-14 08:49:21 UTC
These early alphas (or actually it's just the current ongoing development version) are not recommended for production use. If it works for you then fine, but they may have undiscovered quirks or anything broken at any time and may eat your cat and what not.
Comment 11 r435g391b823-comp176456@yahoo.com.au 2022-07-14 10:02:50 UTC
Thanks Eike, I'll put an ongoing reminder to check for 7.5 stable release. I will ensure the neighbours cats don't use the alpha/dev version for their financial endeavours anymore, in case they're sucked into a LibreOffice Dev Digital world like several eighties sci-fi movies.. can 1980's Meg Ryan star in the LibreOffice Portal to Alternate Dimensions The Movie? I also feel the urge to spill champagne across the computers circuit boards in case it becomes conscious...and a music virtuoso.. ala Electric Dreams [1984]. Anyhoo, thanks to everyone for fixing this functionality.
Comment 12 Laurent Balland 2022-07-14 11:40:27 UTC
(In reply to r435g391b823-comp176456@yahoo.com.au from comment #11)
> Thanks Eike, I'll put an ongoing reminder to check for 7.5 stable release. 
You can follow planed schedule of the next releases here:
https://wiki.documentfoundation.org/ReleasePlan

It's a great pleasure to receive feedback from users :-) with so many winks to 80's :-D
Comment 13 Commit Notification 2022-07-18 10:08:48 UTC
Laurent BP committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/070552010d27fab9e224ad5289cc26a99440fecf

tdf#96723 Number format: embedded text in decimal

It will be available in 7.4.0.2.

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.
Comment 14 Laurent Balland 2022-07-18 11:42:04 UTC
(In reply to r435g391b823-comp176456@yahoo.com.au from comment #9)
> BTW Can I just use this alpha version of libreoffice or is possibly unstable
> somehow and recommend I wait until a proper stable release?

You may notice that this feature has been pushed to 7.4 branch, which will be available by the end of August.
Comment 15 r435g391b823-comp176456@yahoo.com.au 2022-07-18 11:47:42 UTC
Hi Laurent BP, thanks very much indeed for getting that patch into the earlier August 2022 stable release, much appreciated mate! It'll help readability no end. Have a great 2022 Laurent, John.