Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-23-2009, 09:24 PM   #1 (permalink)
Eagle11
Registered Member
 
Eagle11's Avatar
 
Join Date: Aug 2009
Age: 20
Posts: 197
Eagle11 is on a distinguished road
Default Formatting Strings question

I have a question about formatting a string. I have a timer in my app that displays hour:min:sec. Right now I am using this line:

Code:
NSString *nssTimer = [NSString stringWithFormat:@"%2i:%2i:%2i", nsiTimerHour, nsiTimerMin, nsiTimerSeconds];
to format the string. The problem is that is ends of looking like this
#: #: #
when the numbers are less than ten. I want it to look like this
##:##:##
regardless of what the values are.
Is there a way to achieve that?
Eagle11 is offline   Reply With Quote
 

» Advertisements
» Online Users: 725
21 members and 704 guests
ADY, baja_yu, clarky07, dcool, deviceful, djboby, dljeffery, e2applets, GHuebner, JmayLive, jstonebrook, LCANT, nightcrawler2349, poke, reficul, sacha1996, sneaky, spiderguy84, syam_mchrome, Wikiboo, Yoshkow
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,171
Threads: 93,916
Posts: 402,130
Top Poster: BrianSlick (7,966)
Welcome to our newest member, arlethatm26
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:24 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.