---
title: "NSDecimalRound(_:_:_:_:)"
framework: foundation
role: symbol
role_heading: Function
path: "foundation/nsdecimalround(_:_:_:_:)"
---

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

Rounds off the decimal value.

## Declaration

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

## Discussion

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, NSDecimalNumber.RoundingMode.up, NSDecimalNumber.RoundingMode.plain, and NSDecimalNumber.RoundingMode.bankers. For thorough discussions of scale and roundingMode, see NSDecimalNumberBehaviors. For more information, see Number and Value Programming Topics.

## See Also

### Performing arithmetic using references

- [NSDecimalCompact(_:)](foundation/nsdecimalcompact(_:).md)
- [NSDecimalAdd(_:_:_:_:)](foundation/nsdecimaladd(_:_:_:_:).md)
- [NSDecimalSubtract(_:_:_:_:)](foundation/nsdecimalsubtract(_:_:_:_:).md)
- [NSDecimalDivide(_:_:_:_:)](foundation/nsdecimaldivide(_:_:_:_:).md)
- [NSDecimalMultiply(_:_:_:_:)](foundation/nsdecimalmultiply(_:_:_:_:).md)
- [NSDecimalMultiplyByPowerOf10(_:_:_:_:)](foundation/nsdecimalmultiplybypowerof10(_:_:_:_:).md)
- [NSDecimalPower(_:_:_:_:)](foundation/nsdecimalpower(_:_:_:_:).md)
- [NSDecimalNormalize(_:_:_:)](foundation/nsdecimalnormalize(_:_:_:).md)
- [Decimal.RoundingMode](foundation/decimal/roundingmode.md)
- [NSDecimalNumber.RoundingMode](foundation/nsdecimalnumber/roundingmode.md)
- [Decimal.CalculationError](foundation/decimal/calculationerror.md)
- [NSDecimalNumber.CalculationError](foundation/nsdecimalnumber/calculationerror.md)
