Bug 155654

Summary: Example for function Timer is erroneous
Product: LibreOffice Reporter: Gerhard Weydt <gerhard.weydt>
Component: DocumentationAssignee: fpy
Status: RESOLVED FIXED    
Severity: normal CC: olivier.hallot, robert
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard: target:24.8.0
Crash report or crash signature: Regression By:

Description Gerhard Weydt 2023-06-02 20:17:45 UTC
The Help example for the function TIMER is erroneous. This is the sub ExampleTimer in
file:///C:/Program%20Files/LibreOffice/help/de/text/sbasic/shared/03030303.html?DbPAR=BASIC#bm_id3149346
in my Windws installation (in German).
Both divisions should use the backslash instead of the slash. The present implementation yields a value for the hour which istoo great by 1, if the minute value is greater or equal 30, as a result of rounding up the result of the division.
Just run the macro in the second half of an hour to see the error.
Comment 1 Robert Großkopf 2023-06-05 05:53:09 UTC
Could confirm the buggy behavior for LO 
Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: a5c1c674e031087ef0516cebac049341dcdd2fcf
CPU threads: 6; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded

28100 Seconds will be shown as 08:48:20, but should be 07:48:20

My system: OpenSUSE 15.4 64bit rpm Linux.
Comment 2 Commit Notification 2024-03-11 22:50:42 UTC
Pierre F committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/a86b2f1aaaa7b0cceb46e7b6b6c1c58a343b5cb2

fix rounding and use Format()  tdf#155654