• 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
NSNumber Format weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNumber Format weirdness


  • Subject: NSNumber Format weirdness
  • From: Joseph Jones <email@hidden>
  • Date: Thu, 27 Jan 2005 21:08:29 -0800

Hi all,

I am trying to set a custom number format in a number formatter. The format looks like this:

$#.##0,00;0,00;-$#.##0,00

Note that thousands are separated by a period and decimal is separated by a comma. Pretty standard for European based currencies. I am physically setting the thousands separator and decimal separator, setting localizes to NO and setting the format as above. However the formatter comes back with the following format:

$#,###.##000;0,00;-$#,###.##000

Here is the code I am using:

NSNumberFormatter* nsf = (NSNumberFormatter*)[projectCost formatter];
[nsf setLocalizesFormat:NO];
[nsf setDecimalSeparator:dec];
[nsf setThousandSeparator:thou];
[nsf setFormat:[NSString stringWithFormat:@"%@#%@##0%@00;0%@00;-%@#%@##0%@00",
curr, thou, dec,
dec,
curr, thou, dec]];


Anyone know what might be going on here? This is really weird and I can't see why the format I am setting is not sticking.

TIA,
joe

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Retrieving the URL from a Safari copy
  • Next by Date: Re: Retrieving the URL from a Safari copy
  • Previous by thread: Re: Retrieving the URL from a Safari copy
  • Next by thread: Re: NSNumber Format weirdness
  • Index(es):
    • Date
    • Thread