• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

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

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
harsher
Asked:
harsher
  • 2
1 Solution
 
harsherAuthor Commented:
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
 
AlexFMCommented:
   CString s;
    s.Format(_T("%02d:%02d:%02d"), nHours, nMinutes, nSeconds);

    GetDlgItem(IDC_EDIT1)->SetWindowText(s);
0
 
harsherAuthor Commented:
thanx very much.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now