numeric
DDL info: NUMERIC(p,s)
C++ info: UdxBase::UDX_NUMERIC32, UdxBase::UDX_NUMERIC64, UdxBase::UDX_NUMERIC128
struct Numeric32Val
{
CNumeric32 *value;
int precision; // Number of digits (both sides of decimal point)
int scale; // Number of decimal digits
};
struct Numeric64Val
{
CNumeric64 *value;
int precision; // Number of digits (both sides of decimal point)
int scale; // Number of decimal digits
};
struct Numeric128Val
{
CNumeric128 *value;
int precision; // Number of digits (both sides of decimal point)
int scale; // Number of decimal digits
};The precision determines which of the three variations
is used.
- 1 - 9 digits use Numeric1,
- 10 - 18 digits use numeric2
- 19 - 38 digits use Numeric4
The scale value is necessary to determine the meaning of the numeric since it is presented as an integer, with the scale that indicates where the floating point is placed.