• 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
Re: Rounding very small numbers.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rounding very small numbers.


  • Subject: Re: Rounding very small numbers.
  • From: Keary Suska <email@hidden>
  • Date: Thu, 11 Sep 2008 08:40:51 -0600
  • Thread-topic: Rounding very small numbers.

9/11/08 2:11 AM, also sprach email@hidden:

> I attempted to do that with the following code:
>
> NSDecimalNumberHandler* roundingBehavior = [NSDecimalNumberHandler
> decimalNumberHandlerWithRoundingMode:NSRoundPlain scale:5];
>
> NSDecimalNumber *roundFloat = [[[[NSDecimalNumber alloc]
>                         initWithFloat:0.0000000111123]
>                         decimalNumberByRaisingToPower:5]
>                         decimalNumberByRoundingAccordingToBehavior:
> roundingBehavior];
>
> ... but I'm getting the following warning:
>
> "NSDecimalNumberHandler" may not respond to "decimalNumberHandler..."

Yes, because it doesn't. The method is
decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:
raiseOnUnderflow:raiseOnDivideByZero: . There is no shortcut method.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

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

References: 
 >Rounding very small numbers. (From: "Ryan Ragona" <email@hidden>)

  • Prev by Date: Re: NSPredicate BETWEEN inclusive or exclusive?
  • Next by Date: RE: NSXMLParser bug?
  • Previous by thread: Re: Rounding very small numbers.
  • Next by thread: Find Panel Search Metadata
  • Index(es):
    • Date
    • Thread