Solved

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

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

Suggested Solutions

Title # Comments Views Activity
Question regarding Copy/Paste 16 97
fizzArray2 challenge 1 102
haveThree challenge 22 123
moto 4g phone enable finger print 4 45
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.

762 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