Converting time [hh:mm] into decimal format!
Converting time [hh:mm] into decimal format!
Is there anybody out there that can help explain to me how on Earth to tell my computer (program, in C++) how to take an input of time, in the typical hh:mm format; and convert "that" into hours (decimal format). For example, if I were to prompt the question: "How long ago did something occur [hh:mm] _ And the user's response is 2:30 (which would represent 2 hours and thirty minutes ago). How do I explain to the computer to ONLY take the hours (i.e. 2) and add that to ONLY the minutes divided by 60 (i.e. 30/60, which equals 0.5). This should give me 2:30 = 2.5 Now, does anybody know a good way to handle that Please help!
Thanks for any/all help,
~~Chad~~
Converting time [hh:mm] into decimal format!
Imran Koradia
Vaine
Please avoid posting the same question in more than one forum.
The forums are not for general algorithmic issue. Please try doing it your self and if you have specific questions, feel free to post them.
Thanks, Ayman Shoukry VC++ TeamRohan Singh
IS THIS SOME KIND OF JOKE ! I posted this question because I HAVE tried it myself. I knew I should've posted this question on some other web-site. Thanks for not helping, VC++ Team.
Very unhappily,
~~Chad~~