On Dec 11, 2010, at 10:25 PM, Stephen J. Butler wrote:

> On Sat, Dec 11, 2010 at 5:58 PM, WT <jrca...@gmail.com> wrote:
>> [wrt NSNumberFormatter] However, setUsesGroupingSeparator:YES still has no 
>> effect for me.
>> 
>> May I send you (off-list) the test project?
> 
> For those following along at home, this happens to be an iOS project.
> I did this and it seems to work for me:
> 
> 
> - (NSNumberFormatter*) numberFormatter
> {
>    if (numberFormatter_ == nil)
>    {
>         numberFormatter_ = [[NSNumberFormatter alloc] init];
> 
>        [numberFormatter_ setLocale: self.localePtBr];
>        [numberFormatter_ setUsesGroupingSeparator: YES];
>        [numberFormatter_ setNumberStyle:NSNumberFormatterDecimalStyle];
>    }
> 
>    return numberFormatter_;
> }

Yes, setting the number style works for me too though, again, it strikes me odd 
that one should have to set a style for reading data when we can't be sure that 
the data will be in that particular style.

> Looks like on iOS the setNumberStyle: call is required to get it to
> properly handle the grouping separator, while on OS X it isn't.

Apparently so.

> (note: you've got a lot of extra ';' after your method implementations
> that the compiler ignores.. but should probably be cleaned up)

I may be wrong, but I seem to recall that method definitions are allowed to end 
in ';'. I made it a habit to add the terminating semi-colon because it makes it 
easy to copy and paste the method declarations to/from the header and 
implementation files.

Thanks again for all your help. It's much appreciated.
WT_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to