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
>
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 mails | Author | Date |
|---|---|---|
| Jerry Brace | Apr 9, 23:21 | |
| Lee Morgan | Apr 9, 23:26 | |
| Mike Ferris | Apr 11, 16:35 |






Cocoa mail archive

