<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSDecimalRound(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@F@NSDecimalRound"
  },
  "title" : "NSDecimalRound(_:_:_:_:)"
}
-->

# NSDecimalRound(_:_:_:_:)

Rounds off the decimal value.

```
func NSDecimalRound(_ result: UnsafeMutablePointer<Decimal>, _ number: UnsafePointer<Decimal>, _ scale: Int, _ roundingMode: NSDecimalNumber.RoundingMode)
```

## Discussion

Rounds `number` off according to the parameters `scale` and `roundingMode` and stores the result in `result`.

The `scale` value specifies the number of digits `result` can have after its decimal point. `roundingMode` specifies the way that number is rounded off. There are four possible values for `roundingMode`: [`NSDecimalNumber.RoundingMode.down`](/documentation/Foundation/NSDecimalNumber/RoundingMode/down), [`NSDecimalNumber.RoundingMode.up`](/documentation/Foundation/NSDecimalNumber/RoundingMode/up), [`NSDecimalNumber.RoundingMode.plain`](/documentation/Foundation/NSDecimalNumber/RoundingMode/plain), and [`NSDecimalNumber.RoundingMode.bankers`](/documentation/Foundation/NSDecimalNumber/RoundingMode/bankers). For thorough discussions of `scale` and `roundingMode`, see [`NSDecimalNumberBehaviors`](/documentation/Foundation/NSDecimalNumberBehaviors).

For more information, see [Number and Value Programming Topics](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/NumbersandValues/NumbersandValues.html#//apple_ref/doc/uid/10000038i).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)