Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to set an integer value to be displayed '03' instead of just '3' ?

Posted on 2004-04-17
3
Medium Priority
?
194 Views
Last Modified: 2013-11-20
can anyone tell me how to display the integer value, for example '3' to be displayed as 03 in edit box or static text? i'm coding a stop watch program and needs to show the values in 00:00:00 but when i run it, it turns from 00:00:00 to 0 : 0 : 1 ........

i'll give 100  points for this solution. thanx
0
Comment
Question by:harsher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:harsher
ID: 10848087
what i mean is... the program should be showing

00:00:01

but it is showing

0 : 0 : 1

how do i fix it?
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 400 total points
ID: 10848249
   CString s;
    s.Format(_T("%02d:%02d:%02d"), nHours, nMinutes, nSeconds);

    GetDlgItem(IDC_EDIT1)->SetWindowText(s);
0
 

Author Comment

by:harsher
ID: 10848273
thanx very much.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question