• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
A bug in the setRoundingMode:NSNumberFormatterRoundHalfUp?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A bug in the setRoundingMode:NSNumberFormatterRoundHalfUp?


  • Subject: A bug in the setRoundingMode:NSNumberFormatterRoundHalfUp?
  • From: Kevin Hoctor <email@hidden>
  • Date: Wed, 20 Dec 2006 09:49:51 -0600

Does anyone know if there is a bug in the setRoundingMode:NSNumberFormatterRoundHalfUp style? Here is a code fragment I'm using:

[NSNumberFormatter setDefaultFormatterBehavior:NSNumberFormatterBehavior10_4];
decimalFormatter = [[[NSNumberFormatter alloc] init] autorelease];
[decimalFormatter setNumberStyle:NSNumberFormatterDecimalStyle];
[decimalFormatter setRoundingMode:NSNumberFormatterRoundHalfUp];
[decimalFormatter setMinimumFractionDigits:2];
[decimalFormatter setMaximumFractionDigits:2];


		[amount10_4 setFormatter:decimalFormatter];

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).

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


  • Follow-Ups:
    • Re: A bug in the setRoundingMode:NSNumberFormatterRoundHalfUp?
      • From: glenn andreas <email@hidden>
  • Prev by Date: Re: "compiling" .nibs?
  • Next by Date: Re: A bug in the setRoundingMode:NSNumberFormatterRoundHalfUp?
  • Previous by thread: Re: setFetchPredicate binding question - another plea for help
  • Next by thread: Re: A bug in the setRoundingMode:NSNumberFormatterRoundHalfUp?
  • Index(es):
    • Date
    • Thread