Re: NSFormatter troubles (was: NSScanner troubles)
Re: NSFormatter troubles (was: NSScanner troubles)
- Subject: Re: NSFormatter troubles (was: NSScanner troubles)
- From: "Stephen J. Butler" <email@hidden>
- Date: Sat, 11 Dec 2010 17:42:38 -0600
On Sat, Dec 11, 2010 at 5:37 PM, WT <email@hidden> wrote:
> thanks for replying. I tried it and it gives the exact same results as before, that is, the presence of the group separator causes the number formatter to return nil. Besides, there remains the date formatter issue.
Forgive me for using FScript, but I find it easier to prototype these
kinds of Cocoa problems:
> l := NSLocale alloc initWithLocaleIdentifier:'pt_BR'
> nf := NSNumberFormatter alloc init
> nf setLocale:l
> nf setUsesGroupingSeparator:YES
> nf numberFromString:'1.111,20'
1111.2
> df := NSDateFormatter alloc init
> df setLocale:l
> df setDateStyle:NSDateFormatterShortStyle
> df dateFromString:'23/04/2010'
2010-04-23 00:00:00 -0500
Works for me!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden