I can\'t find any resources on this, and I\'ve been trying all sorts of stuff, but nothing works.
According to Apple\'s documentation, you round an NSDecimalNumber l
// get a decimal num from a string
let num = NSDecimalNumber.init(string: numStr)
// create an NSDecimalNumberHandler instance
let behaviour = NSDecimalNumberHandler(roundingMode:.RoundUp,
scale: 1, raiseOnExactness: false,
raiseOnOverflow: false, raiseOnUnderflow:
false, raiseOnDivideByZero: false)
// pass the handler to the method decimalNumberByRoundingAccordingToBehaviour.
// This is an instance method on NSDecimalNumber that takes an object that
// conforms to the protocol NSDecimalNumberBehaviors, which NSDecimalNumberHandler does!
let numRounded = num.decimalNumberByRoundingAccordingToBehavior(behaviour)