Results 1 to 15 of 15

Thread: converting seconds

Threaded View

  1. #10
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: converting seconds

    \ is integer division, so 7600 \ 1000 = 7
    / is normal division, so 7600 / 1000 = 7.6

    the format function performs rounding, so you end up with 8 instead of 7.

    your function won't work for a couple of reasons (try putting in 77600 for example). Try this:
    VB Code:
    1. Private Function ConvertMilliSeconds(ByVal mSec As Long) As String
    2.     ConvertMilliSeconds = Format$(mSec \ 3600000, "00") & ":" & _
    3.                      Format$((mSec Mod 3600000) \ 60000, "00") & ":" & _
    4.                      Format$((mSec Mod 60000) / 1000, "00.000")
    5. End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width