• Top Members
  • 834 Replies
    2585 Replies
  • 716 Replies
    2025 Replies
  • 331 Replies
    1928 Replies

calculation not how it must?

Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
User avatar
VIP - Donator
Posts: 1960

calculation not how it must?

Sun Nov 19, 2017 12:46 pm


we have an combo with items from 01 till 59
it counts minutes

now we have 2 datepickers and when we select an hour from 2 datepickers
we like to get the results from when we pick a value from the combo

that all works fine :D but we don't get the result we like to have
for example:

datepicker1 has : 05:40 AM
datepicker2 has: 01:46 PM

now we get result of 8.06
we like to get when we select from combo like 46min
we must get the result of 7.60
but we get the result of 7.20

how do we fix it?
https://drive.google.com/open?id=1sEUGZ ... bMcB0icTMa

Code: Select all

        tx = IDateTimePicker1.Value
        tx1 = IDateTimePicker2.Value

            tx1 = tx1.AddMinutes(-ComboBox1.Text)
            endt = tx1.ToString("HH:mm:ss")
            Dim HRS As TimeSpan
            Dim _HRS As String
            Dim St As TimeSpan = TimeSpan.Parse(stt)
            Dim Cl As TimeSpan = TimeSpan.Parse(endt)
            HRS = Cl - St

            _HRS = HRS.ToString.Remove(5, 3)
            _HRS = _HRS.ToString.Replace(":", ".")

            If _HRS.StartsWith("0") Then
                _HRS = _HRS.ToString.Remove(0, 1)
                TextBox2.Text = _HRS
                TextBox2.Text = _HRS
            End If

User avatar
VIP - Donator
Posts: 1960

Re: calculation not how it must?

Sat Dec 02, 2017 9:54 am


been sometime and still no solution :(
please somebody? hope we get it managed before the next full moon LOL

Post Reply

Return to “Coding Help & Support”