Re: NSNumberFormatter and space as a thousands separator
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