Re: Rounding very small numbers.
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