diff options
author | Pierre F <fpy@bger.ch> | 2024-03-11 20:08:47 +0100 |
---|---|---|
committer | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | 2024-03-11 23:50:28 +0100 |
commit | a86b2f1aaaa7b0cceb46e7b6b6c1c58a343b5cb2 (patch) | |
tree | eb74085280c447aaf1ac08d131878897d0bf93d4 /source/text/sbasic | |
parent | 3a192b621db3644d50544a64f56ac34909711f92 (diff) |
fix rounding and use Format() tdf#155654
Change-Id: I8a9643fb9713177eba3bb56e93d26a989ac9f099
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/164677
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'source/text/sbasic')
-rw-r--r-- | source/text/sbasic/shared/03030303.xhp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/text/sbasic/shared/03030303.xhp b/source/text/sbasic/shared/03030303.xhp index 3054e52809..8d7e9f6394 100644 --- a/source/text/sbasic/shared/03030303.xhp +++ b/source/text/sbasic/shared/03030303.xhp @@ -51,11 +51,11 @@ <paragraph id="par_idm1341578896" role="bascode" localize="false"> Dim lSec As Long,lMin As Long,lHour As Long</paragraph> <paragraph id="par_idm1341577632" role="bascode" localize="false"> lSec = Timer</paragraph> <paragraph id="par_id3145748" role="bascode"> MsgBox lSec, 0, "Seconds since midnight"</paragraph> - <paragraph id="par_idm1341574656" role="bascode" localize="false"> lMin = lSec / 60</paragraph> + <paragraph id="par_idm1341574656" role="bascode" localize="false"> lMin = Int(lSec / 60)</paragraph> <paragraph id="par_idm1341573424" role="bascode" localize="false"> lSec = lSec Mod 60</paragraph> - <paragraph id="par_idm1341572192" role="bascode" localize="false"> lHour = lMin / 60</paragraph> + <paragraph id="par_idm1341572192" role="bascode" localize="false"> lHour = Int(lMin / 60)</paragraph> <paragraph id="par_idm1341570960" role="bascode" localize="false"> lMin = lMin Mod 60</paragraph> -<paragraph id="par_id3156283" role="bascode"> MsgBox Right("00" & lHour , 2) & ":"& Right("00" & lMin , 2) & ":" & Right("00" & lSec , 2), 0, "The time is"</paragraph> +<paragraph id="par_id3156283" role="bascode"> MsgBox Format(lHour,"00") & ":"& Format(lMin,"00") & ":" & Format(lSec,"00"), 0, "The time is"</paragraph> <paragraph id="par_idm1341567920" role="bascode" localize="false">End Sub</paragraph> </bascode> |