Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-10-2009, 12:57 PM   #1 (permalink)
Glnn
Registered Member
 
Join Date: Jun 2009
Location: Netherlands
Posts: 27
Default double -> string formatting

I'm having trouble formatting a double to a string..

This is the code is use..

Code:
secondLabel.text = [NSString stringWithFormat:@"%i.%i", second, millisecond];

NSString *convert = [NSString stringWithFormat:@"%i.%i", second, millisecond];
kilometers = [convert doubleValue];
kilometers = kilometers * 2.9;
meterLabel.text = [NSString stringWithFormat:@"%d", kilometers];
and this is the result..



Anybody?
Glnn is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,181
Threads: 38,954
Posts: 170,899
Top Poster: smasher (2,565)
Welcome to our newest member, Zephyros
Powered by vBadvanced CMPS v3.1.0

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