Michel,
ik heb één en ander aangepast in de functie en het probleem is opgelost.
Enkel bij bv 126u 1min geeft hij 126:1 en bij de negatieve uren gaat het ook nog effe mis, dit zal ik nog wel aangepast krijgen, anders kom ik er later nog wel eens op terug.
Function fdTotaalTijd2(interval As Double) As String
Dim totalhours As Long, totalminutes As Long, totalseconds As Long
Dim days As Long, hours As Long, minutes As Long, seconds As Long
Dim bNeg As Boolean
If interval < 0 Then
interval = Abs(interval)
bNeg = True
End If
days = Int(CSng(interval))
totalhours = Int(CSng(interval * 24))
totalminutes = Int(CSng(interval * 1440))
totalseconds = Int(CSng(interval * 86400))
hours = (days * 24) + totalhours Mod 24
minutes = totalminutes Mod 60
seconds = totalseconds Mod 60
If bNeg = True Then
If days > 0 Then days = -days
If hours > 0 Then hours = -hours
If minutes > 0 Then minutes = -minutes
If seconds > 0 Then seconds = -seconds
End If
fdTotaalTijd2 = hours & ":" & minutes
End Function
Alvast hartelijk dank voor de hulp.:thumb::thumb::thumb::thumb::thumb:
ik heb één en ander aangepast in de functie en het probleem is opgelost.
Enkel bij bv 126u 1min geeft hij 126:1 en bij de negatieve uren gaat het ook nog effe mis, dit zal ik nog wel aangepast krijgen, anders kom ik er later nog wel eens op terug.
Function fdTotaalTijd2(interval As Double) As String
Dim totalhours As Long, totalminutes As Long, totalseconds As Long
Dim days As Long, hours As Long, minutes As Long, seconds As Long
Dim bNeg As Boolean
If interval < 0 Then
interval = Abs(interval)
bNeg = True
End If
days = Int(CSng(interval))
totalhours = Int(CSng(interval * 24))
totalminutes = Int(CSng(interval * 1440))
totalseconds = Int(CSng(interval * 86400))
hours = (days * 24) + totalhours Mod 24
minutes = totalminutes Mod 60
seconds = totalseconds Mod 60
If bNeg = True Then
If days > 0 Then days = -days
If hours > 0 Then hours = -hours
If minutes > 0 Then minutes = -minutes
If seconds > 0 Then seconds = -seconds
End If
fdTotaalTijd2 = hours & ":" & minutes
End Function
Alvast hartelijk dank voor de hulp.:thumb::thumb::thumb::thumb::thumb: