Bug 127473 - Regression: Formatting error using format "TT.MM.JJJJ HH:MM:SS,000000000000000000"
Summary: Regression: Formatting error using format "TT.MM.JJJJ HH:MM:SS,00000000000000...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: All All
: medium minor
Assignee: Not Assigned
Depends on: 127170
Blocks: Number-Format
  Show dependency treegraph
Reported: 2019-09-10 12:33 UTC by Albrecht Müller
Modified: 2021-02-27 17:06 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:

Example file created using Windows version (13.87 MB, application/vnd.oasis.opendocument.spreadsheet)
2020-04-23 18:57 UTC, Albrecht Müller
Example file created using Linux version (6.10 MB, application/vnd.oasis.opendocument.spreadsheet)
2020-04-23 19:00 UTC, Albrecht Müller

Note You need to log in before you can comment on or make changes to this bug.
Description Albrecht Müller 2019-09-10 12:33:16 UTC
Description: Using format "TT.MM.JJJJ HH:MM:SS,000000000000000000" values that have a zero fractional part get formatted with fewer digits in the fractional part than those whose fractional part is non-zero. Of course, using this kind of format is not a common use case. I stumbled on this while analysing round-off errors in the context of bug 127334.

How to reproduce:
- Open a new spreadsheet
- Make column A wide enough so it can display the formatted values
- Select column A, i.e. the cells A1:A1048576
- Set the number format of this cell range to "TT.MM.JJJJ HH:MM:SS,000000000000000000"
- Fill the range with time values starting vom 10.9.2019 using a time increment of 0.1 seconds. For this purpose open "Tabelle -> Zellen ausfüllen -> Reihen". Set "Reihentyp" to "Linear", "Anfangswert" to "10.9.2019" and "Zunahme" to "00:00:00,1". Press ok. It takes a few moments until the values will show up.

Actual behaviour: The representation of the values representing full seconds is by three digits shorter than that of the other values when using version If you use Version: (x64) all representations use the same length except that in cell A1 where the last three digits are replaced by squares (probably indicating illegal characters).

Expected behaviour: The representation of all values should use the same number of digits.
Comment 1 m.a.riosv 2019-09-11 11:51:29 UTC
Please attach a sample file.
Comment 2 Albrecht Müller 2019-09-11 19:58:14 UTC
For roughly the same reasons I explained in https://bugs.documentfoundation.org/show_bug.cgi?id=127476#c2 I do not want to upload an example file. The real problems are bug 127334 and bug 127477. I mentioned this bug so someone that cares about bug 127334 may keep an eye on this and may occasionally fix it. Note: The time the light needs to travel the size of an atom is longer than the durations that this format allows to express. That is not something I usually have to deal with.
Comment 3 Buovjaga 2020-04-19 15:42:38 UTC
Sample file is required.

Change back to UNCONFIRMED after you have provided the document.
Comment 4 Albrecht Müller 2020-04-23 18:57:30 UTC
Created attachment 159869 [details]
Example file created using Windows version
Comment 5 Albrecht Müller 2020-04-23 19:00:57 UTC
Created attachment 159870 [details]
Example file created using Linux version
Comment 6 m.a.riosv 2020-04-23 20:10:56 UTC
I don't know what the bug is, you are going beyond limits with decimal places. Precision in calc is limited to fifteen numbers plus sing, incluiding decimal places, In fact reducing decimal places to fifteen doesn't show the supposed issue.
Comment 7 Albrecht Müller 2020-04-25 17:51:55 UTC
Previous versions of LibreOffice showed a different behaviour when you went beyond the limit with decimal places. I studied this behaviour in the context of bug 127334. So I reported the changed behaviour in the hope that this may provide insights helpful for fixing this bug.

Nevertheless I think the observed behaviour is a bug of its own right: LibreOffice should either disable the use of so many decimal places or show a consistent and documented behaviour if it allows formats like this - they may be sometimes useful. A decision which option to choose could be made in the context of an ongoing clarification process (bug 127170).
Comment 8 Buovjaga 2020-04-29 10:53:16 UTC
Ok, discussed with Mike K. and he said we should keep this open
Comment 9 b. 2021-02-27 17:06:17 UTC
it's more an oddity than a bug, but, @Albrecht Müller is right (and has sharp eyes) it doesn't have to and shouldn't be like this, the less such inconsistencies develop the less stupid questions arise, and the less confusion is injected into other procedures

not astonishing it's not only TT.MM.JJJJ HH:MM:SS,000000000000000000 affected but also 
TT.MM.JJJJ HH:MM:SS,00000000000000000  
TT.MM.JJJJ HH:MM:SS,0000000000000000 
TT.MM.JJJJ HH:MM:SS,0000000000000000000
TT.MM.JJJJ HH:MM:SS,00000000000000000000
and formats with differenct 'day part' like JJJJ-MM-TT (YYYY-MM-DD) too