Digital Video Forums  

Go Back   Digital Video Forums > Main Forums > Off Topic

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 31 Mar 2010, 08:05 AM   #1
Super Member
Super Member
 
Junkie_ball's Avatar
 
Join Date: Jan 2004
Location: United Kingdom
Posts: 211
Angry Any One Any Good At VB?

Hi

I'm look to format an output of a calculation into time using VB and it's driving me nuts does anyone have any ideas based on the function below?

Example Values

TotalMinutes = 90.5
Distance = 16
PaceCalc = 5.66

I want to display pace calc as minutes and second not just minutes so rather than getting a result of 5.66 minutes i want a result of 5 Minutes 40 Seconds (IE 0.66 times 60 = 39.6 (40 Rounded)). How can i isolate the digits to the right of the decimal place and times these by 60 rather than the whole result?

Code:
    Private Function PaceCalc(ByVal Hours As Integer, ByVal Minutes As Integer, ByVal Seconds As Integer, ByVal Distance As Decimal) As Double


        ' Function Calculates average pace from data supplied from textboxes on form

        Dim Time As New TimeSpan(Hours, Minutes, Seconds)
        Dim TotalMinutes As Double = Time.TotalMinutes

        PaceCalc = TotalMinutes / Distance

    End Function
__________________
SYSTEM:

Pentioum Duo 6400, 8 GB Ram, 500Gb Hardrive, 32x DVD Rom, 16 x TCorp Duel Layer Burner, Geforce 7900GTX.


Bow to the gods of Digital-Digest

http://www.wix.com/martinhopkins/designandphotography
Junkie_ball is offline   Reply With Quote
Old 31 Mar 2010, 08:50 AM   #2
Eclectician
 
MilesAhead's Avatar
 
Join Date: Nov 2006
Posts: 2,615
Default

You should find source here:

http://www.planet-source-code.com/vb...t.asp?lngWId=1
MilesAhead is offline   Reply With Quote
Old 2 Apr 2010, 03:47 AM   #3
Super Member
Super Member
 
Junkie_ball's Avatar
 
Join Date: Jan 2004
Location: United Kingdom
Posts: 211
Default

Quote:
Originally Posted by MilesAhead View Post
thanks for the link u fortunately wasn't able to help in this case but plenty of big hammers and alittle time problem solved.

Will be using that link in the future.
Junkie_ball is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Take the Good with the Bad mill General 59 9 Jan 2006 04:11 AM
How good does VCD get? StudioTHP Junior Members/Newbies 5 13 Sep 2002 03:28 AM



All times are GMT +10. The time now is 02:52 PM.

Kirsch designed by Andrew & Austin


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 1999 - 2018 Digital Digest

Visit DivXLand   Visit dvdloc8.com