• Top Members
Reps
Posts
• 1879 Replies
4367 Replies
• 855 Replies
2870 Replies
• 190 Replies
2821 Replies
• 834 Replies
2585 Replies
• 716 Replies
2576 Replies
• 687 Replies
2454 Replies
• 716 Replies
2025 Replies
• 871 Replies
1960 Replies
• 331 Replies
1928 Replies
• 68 Replies
1890 Replies
• 527 Replies
1758 Replies
• 436 Replies
1610 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.
Dummy1912
VIP - Donator
Posts: 1960

### calculation not how it must?

Hello,

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 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?

Code: Select all

``````        tx = IDateTimePicker1.Value
tx1 = IDateTimePicker2.Value

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
Else
TextBox2.Text = _HRS
End If

``````

Dummy1912
VIP - Donator
Posts: 1960

### Re: calculation not how it must?

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