API  0.9.10
CPDecimalNumberHandler(CPDecimalNumberBehaviors) Category Reference

Instance Methods

(CPDecimalNumber- exceptionDuringOperation:error:leftOperand:rightOperand:
 
(CPRoundingMode) - roundingMode
 
(short) - scale
 

Detailed Description

Definition at line 141 of file CPDecimalNumber.j.

Method Documentation

◆ exceptionDuringOperation:error:leftOperand:rightOperand:()

- (CPDecimalNumber) exceptionDuringOperation: (SEL)  operation
error: (CPCalculationError)  error
leftOperand: (CPDecimalNumber leftOperand
rightOperand: (CPDecimalNumber rightOperand 
implementation

This method is invoked by the framework when an exception occurs on a decimal operation. Depending on the specified behaviour of the CPDecimalNumberHandler this will throw exceptions accordingly with formatted error messages.

Parameters
operationthe selector of the method of the operation being performed when the exception occurred
errorthe actual error type. From the CPCalculationError enum: CPCalculationNoError, CPCalculationLossOfPrecision, CPCalculationOverflow, CPCalculationUnderflow, CPCalculationDivideByZero
leftOperandthe CPDecimalNumber left-hand side operand used in the calculation that caused the exception
rightOperandthe CPDecimalNumber right-hand side operand used in the calculation that caused the exception
Returns
if appropriate a CPDecimalNumber is returned (either the maximum, minimum or NaN values), or nil

Extends class CPDecimalNumberHandler.

Definition at line 180 of file CPDecimalNumber.j.

◆ roundingMode()

- (CPRoundingMode) roundingMode
implementation

Returns the current rounding mode. One of CPRoundingMode enum: CPRoundPlain, CPRoundDown, CPRoundUp, CPRoundBankers.

Returns
the current rounding mode

Extends class CPDecimalNumberHandler.

Definition at line 148 of file CPDecimalNumber.j.

◆ scale()

- (short) scale
implementation

Returns the number of digits allowed after the decimal point.

Returns
the current number of digits

Extends class CPDecimalNumberHandler.

Definition at line 157 of file CPDecimalNumber.j.


The documentation for this category was generated from the following file: