Class

NSDecimalNumberHandler

A class that adopts the decimal number behaviors protocol.

Declaration

@interface NSDecimalNumberHandler : NSObject

Overview

This class allows you to set the way an NSDecimalNumber object rounds off and handles errors, without having to create a custom class.

You can use an instance of this class as an argument to any of the NSDecimalNumber methods that end with ...Behavior:. If you don’t think you need special behavior, you probably don’t need this class—it is likely that NSDecimalNumber's default behavior will suit your needs.

For more information, see the NSDecimalNumberBehaviors protocol specification.

Topics

Creating a Decimal Number Handler

defaultDecimalNumberHandler

Returns the default instance of NSDecimalNumberHandler.

Initializing a decimal number handler

- initWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:

Returns an NSDecimalNumberHandler object initialized so it behaves as specified by the method’s arguments.

Relationships

Inherits From

See Also

Managing Behavior

defaultBehavior

The way arithmetic methods round off and handle error conditions.

NSDecimalNumberBehaviors

A protocol that declares three methods that control the discretionary aspects of working with decimal numbers.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software