Announcement

Collapse
No announcement yet.

Any One Any Good At VB?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Junkie_ball
    Super Member
    Super Member
    • Jan 2004
    • 211

    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
  • MilesAhead
    Eclectician
    • Nov 2006
    • 2615

    #2
    You should find source here:

    Comment

    • Junkie_ball
      Super Member
      Super Member
      • Jan 2004
      • 211

      #3
      Originally Posted by MilesAhead
      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.
      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

      Comment

      Working...
      😀
      🥰
      🤢
      😎
      😡
      👍
      👎