format timeserial issue

ZeroEffect

Junior Contributor
Joined
Oct 24, 2004
Messages
204
Location
Detroit, MI
for some reason I am having a mental block. All I am trying to do is format the current position in media player to have tenths of a second using the current position on mediaplayer, timeserial, and format. I get everything I want except the tenths of a second.

Visual Basic:
mpPlayer.CurrentPosition returns 27.5472404

TimeSerial(0, 0, mpPlayer.CurrentPosition) returns 12:00:31 AM

Format(TimeSerial(0, 0, mpPlayer.CurrentPosition), "m:ss.f") returns 0:31.0
but it is always .0

Any suggestions on how can I get tenths of a second?


Thanks

ZeroEffect
 
I am currently working with this but I seem to be missing something.

Visual Basic:
TempData = Format(TimeSerial(0, 0, mpPlayer.CurrentPosition), "m:ss.") &_
Format(mpPlayer.CurrentPosition - Int(mpPlayer.CurrentPosition), "f") 

This returns 0:00.0.00 not 0:00.0

thanks for any thoughts you may have,

ZeroEffect
 
How about this:
Visual Basic:
' mpPlayer.CurrentPosition = 27.5472404
Dim CurrentPosition As String = String.Format("{0:0,#}", mpPlayer.CurrentPosition)
' Will Display as 27.5
 
Back
Top