Protocol

NSDecimal​Number​Behaviors

The NSDecimal​Behaviors protocol declares three methods that control the discretionary aspects of working with NSDecimal​Number objects.

Overview

The scale() and rounding​Mode() methods determine the precision of NSDecimal​Number’s return values and the way in which those values should be rounded to fit that precision. The exception​During​Operation(_:​error:​left​Operand:​right​Operand:​) method determines the way in which an NSDecimal​Number object should handle different calculation errors.

For an example of a class that adopts the NSDecimal​Behaviors protocol, see the specification for NSDecimal​Number​Handler.

Symbols

Rounding

func rounding​Mode()

Returns the way that NSDecimal​Number's decimal​Number​By... methods round their return values.

func scale()

Returns the number of digits allowed after the decimal separator.

Constants

Relationships