Re: A bug in the setRoundingMode:NSNumberFormatterRoundHalfUp?
Re: A bug in the setRoundingMode:NSNumberFormatterRoundHalfUp?
- Subject: Re: A bug in the setRoundingMode:NSNumberFormatterRoundHalfUp?
- From: Kevin Hoctor <email@hidden>
- Date: Wed, 20 Dec 2006 13:45:55 -0600
On Dec 20, 2006, at 12:29 PM, glenn andreas wrote:
On Dec 20, 2006, at 9:49 AM, Kevin Hoctor wrote:
Does anyone know if there is a bug in the
setRoundingMode:NSNumberFormatterRoundHalfUp style? Here is a code
fragment I'm using:
[snip]
It behaves like setRoundingMode:NSNumberFormatterRoundHalfEven
when I put in .125 I get .13 and .135 I get .14. Everything else
seems to work correctly for 10.4 behavior (except the currency
style which is forcing the entry of a localized currency sign, but
that one I've read about).
Maybe I'm misunderstanding something, but
NSNumberFormatterRoundHalfUp:
.125 -> .13
.135 -> .14
NSNumberFormatterRoundHalfEven:
.125 -> .12
.135 -> .14
NSNumberFormatterRoundHalfDown:
.125 -> .12
.135 -> .13
So if .125 -> .13, and .135 -> .14, then this looks like how
NSNumberFormatterRoundHalfUp is suppose to work (i.e., it's not
behaving like NSNumberFormatterRoundHalfEven because then you'd
get .12 and .14).
My bad. I am getting .12 from .125 and .14 from .135 so
NSNumberFormatterRoundHalfUp is acting just like
NSNumberFormatterRoundHalfEven. I just typed my example wrong.
Now I just tried to recompile it after a clean all because I was
getting .125 -> 0.125 for 10.4 behavior. It seems to be ignoring the
minimum fractional setting because .1 -> 0.1 instead of 0.10 (like
the 10.0 behavior entry is showing). How very odd and disturbing.
This shouldn't be taking up this much of my time. What am I missing
here?
Peace,
Kevin Hoctor
No Thirst Software
http://nothirst.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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