• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Number Formatting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: File's Owner
  • Next by Date: Re: File's Owner
  • Previous by thread: Re: File's Owner
  • Next by thread: Memory management problem in using of NSConnection
  • Index(es):
    • Date
    • Thread