| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello, can anyone help me. I can not figure out how to conver
the number of minutes(173.317) into hours, minutes and seconds. Please help me!! wagnerm |
|
#2
|
|||
|
|||
|
You will want to first Divide the number of minutes by 60 to give u the amount of hours.
173.313/ 60 = 2.88616.... than if you take the decimal and multply it by 60 itll give you the minutes. .88616 * 60 = 53.317 than take that decimal and multply by another 60 to give the seconds .317 * 60 = 19 seconds so The total is 2 hours 53 minutes and 19 seconds. Something like this may work: Note: 'numb' is the initial number to be broken down int hours = static_cast<int>(numb / 60); int minutes = static_cast<int>(numb - (hours * 60)); int seconds = static_cast<int>((numb-(hours*60) - minutes) * 60); |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Please help me I need help converting minutes to hh:mm:ss |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|