•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 375,170 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,210 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 666 | Replies: 2
![]() |
•
•
Join Date: Mar 2007
Posts: 2
Reputation:
Rep Power: 0
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:
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,199
Reputation:
Rep Power: 34
Solved Threads: 824
modf() will help you split a floating point number into its integer and fractional parts. see man pages for more details8
'Politics' is made up of two words, 'poli,' which is Greek for 'many,' and 'tics,' which are blood-sucking insects.
- Gore Vidal
Being ignorant is not so much a shame as being unwilling to learn. - Benjamin Franklin
- Gore Vidal
Being ignorant is not so much a shame as being unwilling to learn. - Benjamin Franklin
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
- Question: Linear Time Sorting Problem (Computer Science and Software Design)
- Included file not found during compile time. (C++)
- PHP, ASP, ColdFusion, what's your fav? (IT Technologies and Trends)
- 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 / 2003)
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



Linear Mode