Hello All,
This is probably easy, but I'm struggling with it.
I want to make a very small program where the user inputs a starting time and an ending time that is in "clock time (?)" and the program converts it to total minutes in one box and a decimal total in a second box.
I have 4 textboxes, 2 are masked text boxes (military time) for input and two are not, for output and the math is coming out weird. If I put a start time of 0925 and an end time of 1015, the results I'm expecting would be 50 total minutes and .83333 total as a decimal. I don't think I'm converting the textbox input correctly as I'm not getting anything near that. I am using a button to calculate and another to clear the boxes, just FYI.
Also, I'm not sure what to do about any times that span the noon hour except to use an absolute value, so any thoughts with that would be great!
Thanks in advance!
This is probably easy, but I'm struggling with it.
I want to make a very small program where the user inputs a starting time and an ending time that is in "clock time (?)" and the program converts it to total minutes in one box and a decimal total in a second box.
I have 4 textboxes, 2 are masked text boxes (military time) for input and two are not, for output and the math is coming out weird. If I put a start time of 0925 and an end time of 1015, the results I'm expecting would be 50 total minutes and .83333 total as a decimal. I don't think I'm converting the textbox input correctly as I'm not getting anything near that. I am using a button to calculate and another to clear the boxes, just FYI.
Also, I'm not sure what to do about any times that span the noon hour except to use an absolute value, so any thoughts with that would be great!
Thanks in advance!
VB.NET:
Public Function Time()
Dim StartTime As Double
Dim Endtime As Double
StartTime = txtStart.Text
Endtime = txtEnd.Text
txtDecimal.Text = (Endtime - StartTime) / 60
txtMinutes.Text = Endtime - StartTime
End Function
Last edited: