Bug 155654 - Example for function Timer is erroneous
Summary: Example for function Timer is erroneous
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: fpy
URL:
Whiteboard: target:24.8.0
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-02 20:17 UTC by Gerhard Weydt
Modified: 2024-03-11 22:53 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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