Number Formatting
Number Formatting
- Subject: Number Formatting
- From: davidjclark <email@hidden>
- Date: Fri, 30 Nov 2001 16:15:34 -0500
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