?
Solved

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

Posted on 2004-04-17
3
Medium Priority
?
191 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

771 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