---
title: NSDecimalNumberHandler
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsdecimalnumberhandler
---

# NSDecimalNumberHandler

A class that adopts the decimal number behaviors protocol.

## Declaration

```swift
class NSDecimalNumberHandler
```

## Overview

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

- [default](foundation/nsdecimalnumberhandler/default.md)

### Initializing a decimal number handler

- [init(roundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:)](foundation/nsdecimalnumberhandler/init(roundingmode:scale:raiseonexactness:raiseonoverflow:raiseonunderflow:raiseondividebyzero:).md)

### Initializers

- [init(coder:)](foundation/nsdecimalnumberhandler/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSDecimalNumberBehaviors](foundation/nsdecimalnumberbehaviors.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Configuring Rounding Behavior

- [roundingBehavior](foundation/numberformatter/roundingbehavior.md)
- [roundingIncrement](foundation/numberformatter/roundingincrement.md)
- [roundingMode](foundation/numberformatter/roundingmode-swift.property.md)
