Re: How do I convert NSNumber value to NSString?
Re: How do I convert NSNumber value to NSString?
- Subject: Re: How do I convert NSNumber value to NSString?
- From: Mike Ferris <email@hidden>
- Date: Mon, 11 Apr 2005 07:35:05 -0700
There's also printf style formatting for a bit more control over the
numeric format.
For example:
str = [NSString stringWithFormat:@"%.2g", [myNumber doubleValue]];
Mike Ferris
How about simply
NSString *myString = [aNumber stringValue];
So...
NSLog([aNumber stringValue]);
Also the two following are very handy at times...
NSLog(@"%@", aNumber); // Log any cocoa object
NSLog([aNumber description]); // Log a string description of any cooca
object
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden