NSDecimalRound(_:_:_:_:)
Rounds off the decimal value.
Declaration
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, 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(_:)NSDecimalAdd(_:_:_:_:)NSDecimalSubtract(_:_:_:_:)NSDecimalDivide(_:_:_:_:)NSDecimalMultiply(_:_:_:_:)NSDecimalMultiplyByPowerOf10(_:_:_:_:)NSDecimalPower(_:_:_:_:)NSDecimalNormalize(_:_:_:)Decimal.RoundingModeNSDecimalNumber.RoundingModeDecimal.CalculationErrorNSDecimalNumber.CalculationError