Re: NSString stringWithFormat woes
Re: NSString stringWithFormat woes
- Subject: Re: NSString stringWithFormat woes
- From: Michael Vannorsdel <email@hidden>
- Date: Tue, 8 Apr 2008 18:05:52 -0600
Try casting them to ints before formatting:
returnString = [NSString stringWithFormat:@"%c-%i-%i-%f", asciiString,
(int)firstDouble, (int)secondDouble, thirdDouble];
On Apr 8, 2008, at 1:33 PM, Stuart Green wrote:
Hi,
I have a string declaration of:
returnString = [NSString stringWithFormat:@"%c-%i-%i-%f",
asciiString, firstDouble, secondDouble, thirdDouble];
Which is producing a weird output when used outside of an NSLog.
Examining each parameter in the debugger shows exactly what I want,
i.e. an ASCII string, a floored double (no decimals), another
floored double (no decimals) and a double with a decimal.
What do I need to do in order to display them correctly in the
returnString?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden