DB2®RoundingMode Enumeration

Specify the rounding mode to use with DB2DecimalFloat structures.

Namespace:
IBM.Data.DB2
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax


[Visual Basic]
<Serializable>
Public Enum DB2RoundingMode
[C#]
[Serializable]
public enum DB2RoundingMode
[C++]
[Serializable]
__value public enum DB2RoundingMode
[JScript]
public
   Serializable
enum DB2RoundingMode

Remarks

The DB2RoundingMode enumeration is used when populating a DB2DecimalFloat instance using the DB2DecimalFloat.Parse method.

Table 1. Members
Member Description
Ceiling Round toward positive infinity. If all of the discarded digits are zero or if the sign is negative, the result is unchanged. Otherwise, the result coefficient should be incremented by 1 (rounded up).
Down Round toward 0 (truncation). The discarded digits are ignored.
Floor Round toward negative infinity. If all of the discarded digits are zero or if the sign is positive, the result is unchanged. Otherwise, the sign is negative and the result coefficient should be incremented by 1 (rounded up).
HalfDown Round to nearest; if equidistant, round down. If the discarded digits represent greater than half (0.5) of the value of a one in the next left position, then the result coefficient should be incremented by 1 (rounded up). Otherwise (if the discarded digits are 0.5 or less), the discarded digits are ignored.
HalfEven Round to nearest; if equidistant, round so that the final digit is even. If the discarded digits represent greater than half (0.5) the value of a one in the next left position, then the result coefficient should be incremented by 1 (rounded up). If they represent less than half, then the result coefficient is not adjusted (that is, the discarded digits are ignored). Otherwise (if they represent exactly half), the result coefficient is unaltered if its rightmost digit is even, or incremented by 1 (rounded up) if its rightmost digit is odd (to make an even digit).
HalfUp Round to nearest; if equidistant, round up. If the discarded digits represent greater than or equal to half (0.5) of the value of a one in the next left position then the result coefficient should be incremented by 1 (rounded up). Otherwise, the discarded digits are ignored.
Up Round away from 0. If all of the discarded digits are zero the result is unchanged. Otherwise, the result coefficient should be incremented by 1 (rounded up).