Class DecimalData

java.lang.Object
com.ibm.dataaccess.DecimalData

public final class DecimalData extends Object
Routines to convert between decimal data types stored in byte arrays and Java binary types.

All the converter routines require the precision of the decimal value to convert, which represents the number of decimal digits in the decimal value, not including the sign.

Unicode Decimal values can be represented as either a char array or as a byte array where every Unicode character is represented by a pair of adjacent bytes.

For embedded sign nibbles (4 bit integers representing values between 0x0 and 0xF inclusive) in External Decimal or Packed Decimal data, 0xB and 0xD represent a negative sign. All other sign nibble values represent a positive sign. For operations that produce an External Decimal or Packed Decimal result, the Data Access Accelerator library inserts the preferred positive sign code of 0xC if the result is positive, and a preferred negative sign code of 0xD if the result is negative. All values between 0x0 and 0xF inclusive are interpreted as valid sign codes.

This library has full support for signed integers but only limited support for scale points (decimals). Scale points and other unrecognized characters found in input External, Unicode, or Packed Decimal byte arrays are not supported, and may cause IllegalArgumentExceptions or undefined results. BigDecimal inputs will have scale ignored (i.e. -1.23 will be interpreted as -123). When converting to BigDecimal (as output), a scale value may be explicitly specified as a separate parameter.