Solved

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

Posted on 2004-04-17
3
185 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 100 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

732 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