Re: NumberFormatters and sci notation
Re: NumberFormatters and sci notation
- Subject: Re: NumberFormatters and sci notation
- From: Greg Titus <email@hidden>
- Date: Wed, 18 Jan 2006 07:17:24 -0800
On Jan 18, 2006, at 7:00 AM, Graham J Lee wrote:
On 18 Jan 2006, at 14:50, Johan Kool wrote:
Did this not work?
[fmt setFormat:@"##0,00.00"];
I have not tried this myself, but it's how I would expect it should
work from the documentation.
It gives results like:
0.2000000000000123
and:
5.551115123125783e-17
when used in combination with -setNumberStyle: which doesn't appear
correct at all. BTW I'm instantiating and attaching the formatter
in my NSDocument subclass' -init method, as the text fields are
outlets of that class.
Ah, there's your problem. When the document subclass -init is called,
the nib hasn't yet been loaded, so the outlets aren't yet setup. So
you are attaching the formatter to nil. Try moving the instantiation
and attachment to the -awakeFromNib method.
Hope this helps,
- Greg
_______________________________________________
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