Bug 160696 - CALC: Rounding for Time Value does not work
Summary: CALC: Rounding for Time Value does not work
Status: CLOSED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-16 15:53 UTC by Michael
Modified: 2024-04-16 19:31 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
CALC: Time Rounding (18.77 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-04-16 15:56 UTC, Michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2024-04-16 15:53:22 UTC
Description:
We need the starting value (line 1) 00:02:08,657 rounded to full seconds.

  

Steps to Reproduce:
Please refer to the attached .ODS: We tried two versions Time formatted HH:MM:SS and [HH]:MM:SS, not understandable why [HH] provide the expected result for the seconds. Round to HH:MM:SS,00 or HH:MM:SS,0 works well.

Actual Results:
Please refer to the attached .ODS

Expected Results:
For 00:02:08,657 rounded to full seconds; the result of 00:02:09 is expected!


Reproducible: Always


User Profile Reset: No

Additional Info:
Issue found 
Version: 6.3.3.2 (x64) 
Build-ID: a64200df03143b798afd1ec74a12ab50359878ed 
CPU-Threads: 8; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE 
Calc: CL 

Version: 7.3.6.2 / LibreOffice Community
Build ID: c28ca90fd6e1a19e189fc16c05f8f8924961e12e
CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded
Comment 1 Michael 2024-04-16 15:56:06 UTC
Created attachment 193709 [details]
CALC: Time Rounding
Comment 2 Eike Rathke 2024-04-16 16:51:04 UTC
HH:MM:SS is a clock format, it does not round into seconds. If it did, then 23:59:59.9 would result in 00:00:00 (24:00:00 but wrapped around), and along with a date (like YYYY-MM-DD HH:MM:SS) it even would display 00:00:00 of the next day.

[HH]:MM:SS is a duration format that rounds and would display 24:00:00, similar for [MM]:SS and [SS].

If you still need to round into seconds along with a HH:MM:SS format then use
=ROUND(B1*86400)/86400
Comment 3 Robert Großkopf 2024-04-16 19:31:00 UTC
(In reply to Eike Rathke from comment #2)
> HH:MM:SS is a clock format, it does not round into seconds. If it did, then
> 23:59:59.9 would result in 00:00:00 (24:00:00 but wrapped around), and along
> with a date (like YYYY-MM-DD HH:MM:SS) it even would display 00:00:00 of the
> next day.

And what would be wrong if it does? The date has to show the next day, if rounded…