• 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
Re: NSNumberFormatter and space as a thousands separator
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSNumberFormatter and space as a thousands separator


  • Subject: Re: NSNumberFormatter and space as a thousands separator
  • From: Joakim Danielson <email@hidden>
  • Date: Tue, 18 Jan 2005 19:13:24 +0100

If the space is used as a thousand separator for the default locale, you can do it like this:

NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease];
[numberFormatter setFormat:@"#,###.00;0.00;-#,##0.00"];
[numberFormatter setLocalizesFormat:YES];

Joakim


On 2005-01-18, at 16.41, mathieu martin wrote:

Hello,

I am trying to use space character to do the thousands separtion in a
text field but the NSNumberFormatter doesn't seem to accept it.

with that code:
NSNumberFormatter *testFormater = [[NSNumberFormatter alloc] init];
[testFormater setFormat:@" # ###.00;0.00;- # ##0.00"];

NSLog(@"testFormater = %@", [testFormater positiveFormat]);
NSLog(@"testFormater = %@", [testFormater negativeFormat]);

I get :
testFormater = ####.00
testFormater = - ###0.00

Is there a specific value for the space character to use it in this
kind of formatter ?
Is some could help me on this


thanks in advance

regards

Mathieu
_______________________________________________
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

 _______________________________________________
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

References: 
 >NSNumberFormatter and space as a thousands separator (From: mathieu martin <email@hidden>)

  • Prev by Date: Re: Find panel tutorial?
  • Next by Date: Re: Determining if it is the first time the application has launched?
  • Previous by thread: NSNumberFormatter and space as a thousands separator
  • Next by thread: NSToolbarItem - how to have it respond to a subview?
  • Index(es):
    • Date
    • Thread