Re: floats and number formatters
Re: floats and number formatters
- Subject: Re: floats and number formatters
- From: John Stiles <email@hidden>
- Date: Wed, 14 Jul 2004 16:04:37 -0700
Or good old %g.
On Jul 14, 2004, at 3:30 PM, Daniel Todd Currie wrote:
>
An easier way to do something this simple might be to use format
>
strings:
>
>
[NSString stringWithFormat:@"%1.2f", floatValue]
>
>
-- DTC
>
>
>
>
On 2004 Jul 14, at 15:04, John Spicer wrote:
>
>
> I have a field that receives a calculated value. I have a formatter
>
on
>
> the field, set to +/-9999.99 (two digit precision).
>
>
>
> The calculation returns something like 44.4599999, I **thought** the
>
> formatter would round it to two digits (i.e. 44.46) but that's not
>
> what I'm getting. I do get displayed 44.4599999.
>
>
>
> What am I missing?
>
> _______________________________________________
>
> cocoa-dev mailing list | email@hidden
>
> Help/Unsubscribe/Archives:
>
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
> Do not post admin requests to the list. They will be ignored.
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.