Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Number Formatting



Hello,

Can someone clue me in on why the following code does not work ? The number returned by descriptionWithLocale: is not being formatted as it should be. For instance, if theNumber is 2000, theString is returned as 2000. It should be returning 2,000.

- ( NSString * ) _commaDelimitedSize:(UInt64) theNumber

{

NSDecimalNumber *decimalNumber;
NSString *theString;

decimalNumber = [ NSDecimalNumber numberWithUnsignedLongLong:theNumber ];
theString = [ decimalNumber descriptionWithLocale:[ [NSUserDefaults standardUserDefaults] dictionaryRepresentation ] ];

NSLog(@"The String : %@", theString );

return theString;

}

TIA,

David




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.