I have some text time fields in HHMM format and I need to convert the DIFFERNCET between the text times to a decimal value. Below are the 2 text time columns "TextStartTime" and "TextEndTime" and a column called "Difference in Text Time" that is the difference between
TextStartTime Text end time Diff. in Text Time Decimal TIME in Hours
0930 1300 370 3.5
1015 1700 685 6.45
930 1600 670 6.5
0945 1725 780 7.66
0930 1540 610 6.16
1000 1645 645 6.75
I know this is not an R problem but what algorithm can I use to convert the "Difference in Text Time" field to the "Decimal Time in hours field"?
I started by saying if the minutes of the "Difference in Text Time" column are >30 then subtract 40 from the minutes so the "670" would be "630" and then I can convert the 630 to 6.5 BUT that does not work for the "645" when I subtract 40 I get