Skip navigation.
 
mlRe: How do I convert NSNumber value to NSString?
FROM : Mike Ferris
DATE : Mon Apr 11 16:35:05 2005

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
>

Related mailsAuthorDate
mlHow do I convert NSNumber value to NSString? Jerry Brace Apr 9, 23:21
mlRe: How do I convert NSNumber value to NSString? Lee Morgan Apr 9, 23:26
mlRe: How do I convert NSNumber value to NSString? Mike Ferris Apr 11, 16:35