| | |
Easy question: Decimals to time
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2007
Posts: 2
Reputation:
Solved Threads: 0
I am using c++ and would like to know the easiest way to turn decimals in to the form hours:minutes:seconds.
You can assume the integer is in the form of hours (e.g. 242.4 = 242 hours 24 seconds etc)
Also, I would like it so that seconds is to one decimal place, and that if a field is blank it will show up like this 00:00:00.0
Thanks heaps :mrgreen:
You can assume the integer is in the form of hours (e.g. 242.4 = 242 hours 24 seconds etc)
Also, I would like it so that seconds is to one decimal place, and that if a field is blank it will show up like this 00:00:00.0
Thanks heaps :mrgreen:
modf() will help you split a floating point number into its integer and fractional parts. see man pages for more details8
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Similar Threads
- Question: Linear Time Sorting Problem (Computer Science)
- Included file not found during compile time. (C++)
- PHP, ASP, ColdFusion, what's your fav? (IT Professionals' Lounge)
- Pause (C++)
- EASY question? checking for line feed (return) in a html file with C++ (C++)
- i need help (C++)
- A question of RAM (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: How to get path of current appl (in char) for Mac OS X
- Next Thread: Enter string to the next line
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings struct temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






