james_sgp Active Member Licensed User Longtime User Jul 31, 2022 #1 Hi, I`m converting my B4a app to run on B4i; but it have a problem that B4i doesn`t undetstand the "mod" function I`m using: B4X: Copy NumberFormat2(Floor(t/DateTime.TicksPerSecond),1,0,0,False)&"."&NumberFormat2(Floor((t Mod DateTime.TicksPerSecond)/10),2,0,0,False) Does anyone have a work around? Thanks in advance. James
Hi, I`m converting my B4a app to run on B4i; but it have a problem that B4i doesn`t undetstand the "mod" function I`m using: B4X: Copy NumberFormat2(Floor(t/DateTime.TicksPerSecond),1,0,0,False)&"."&NumberFormat2(Floor((t Mod DateTime.TicksPerSecond)/10),2,0,0,False) Does anyone have a work around? Thanks in advance. James
Filippo Expert Licensed User Longtime User Jul 31, 2022 #2 james_sgp said: Hi, I`m converting my B4a app to run on B4i; but it have a problem that B4i doesn`t undetstand the "mod" function I`m using: B4X: Copy NumberFormat2(Floor(t/DateTime.TicksPerSecond),1,0,0,False)&"."&NumberFormat2(Floor((t Mod DateTime.TicksPerSecond)/10),2,0,0,False) Does anyone have a work around? Thanks in advance. James Click to expand... The equivalent function "Mod" of B4i is: Bit.FMod() B4X: Copy NumberFormat2(Floor(t/DateTime.TicksPerSecond),1,0,0,False)&"."&NumberFormat2(Bit.FMod(t/DateTime.TicksPerSecond, 10),2,0,0,False) Upvote 0
james_sgp said: Hi, I`m converting my B4a app to run on B4i; but it have a problem that B4i doesn`t undetstand the "mod" function I`m using: B4X: Copy NumberFormat2(Floor(t/DateTime.TicksPerSecond),1,0,0,False)&"."&NumberFormat2(Floor((t Mod DateTime.TicksPerSecond)/10),2,0,0,False) Does anyone have a work around? Thanks in advance. James Click to expand... The equivalent function "Mod" of B4i is: Bit.FMod() B4X: Copy NumberFormat2(Floor(t/DateTime.TicksPerSecond),1,0,0,False)&"."&NumberFormat2(Bit.FMod(t/DateTime.TicksPerSecond, 10),2,0,0,False)
Erel B4X founder Staff member Licensed User Longtime User Jul 31, 2022 #3 [B4X] Convert milliseconds to string This code converts milliseconds to hours, minutes and seconds: Sub ConvertMillisecondsToString(t As Long) As String Dim hours, minutes, seconds As Int hours = t / DateTime.TicksPerHour minutes = (t Mod DateTime.TicksPerHour) / DateTime.TicksPerMinute seconds = (t Mod... www.b4x.com Upvote 0
[B4X] Convert milliseconds to string This code converts milliseconds to hours, minutes and seconds: Sub ConvertMillisecondsToString(t As Long) As String Dim hours, minutes, seconds As Int hours = t / DateTime.TicksPerHour minutes = (t Mod DateTime.TicksPerHour) / DateTime.TicksPerMinute seconds = (t Mod... www.b4x.com
james_sgp Active Member Licensed User Longtime User Jul 31, 2022 #4 Great, thanks for the replies gentlemen...that gets me going. Upvote 0