Bug 163344 - Loading "14:30" time value from ODS produces a different result compared to DATE, DATEVALUE, or direct input
Summary: Loading "14:30" time value from ODS produces a different result compared to D...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL: https://ask.libreoffice.org/t/copy-ti...
Whiteboard: target:25.2.0 target:24.8.3
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-07 19:56 UTC by Mike Kaganski
Modified: 2024-10-21 10:45 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
14:30 stored in a spreadsheet (777 bytes, application/vnd.oasis.opendocument.spreadsheet)
2024-10-07 19:56 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2024-10-07 19:56:16 UTC
Created attachment 196954 [details]
14:30 stored in a spreadsheet

In the attached FODS, there is "14:30" time value in A1 (stored as "PT14H30M00S"), and a formula in B1, comparing A1 to the result of TIME(14;30;0). In current master, as well as in e.g. Version: 6.0.0.3 (x64)
Build ID: 64a0f66915f38c6217de274f0aa8e15618924765
CPU threads: 24; OS: Windows 10.0; UI render: default; 
Locale: en-US (ru_RU); Calc: CL

the difference is around 1.11E-16, instead of expected 0. The actual double value in A1 is 0.60416666666666674, while TIME returns 0.60416666666666663 (1 ulp difference).

This may result in unexpected results e.g. on sorting, as explained in https://ask.libreoffice.org/t/copy-time-from-csv-to-ods-not-working-correct/112053.
Comment 1 Mike Kaganski 2024-10-07 21:15:32 UTC
https://gerrit.libreoffice.org/c/core/+/174650
Comment 2 Commit Notification 2024-10-08 05:32:53 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9c9d2e21be06fa1c806c110812d6df783109d8b9

tdf#163344: improve Converter::convertDuration

It will be available in 25.2.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 3 Commit Notification 2024-10-21 10:45:45 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/a03df92a0ca6ae04cb99bb9ab678e31d82363879

tdf#163344: improve Converter::convertDuration

It will be available in 24.8.3.

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.