MATH_NUMERIC APIs
The string members of the MATH_NUMERIC data structure are in ZCHAR (non-Unicode) format. The JD Edwards EnterpriseOne Common Library API includes several functions that retrieve and manipulate these strings in both JCHAR (Unicode) and ZCHAR (non-Unicode) formats.
To retrieve the string value of a MATH_NUMERIC data type in JCHAR format, use the FormatMathNumeric API function. This example illustrates the use of this function:
/* Declare variables */ JCHAR szJobNumber[MAXLEN_MATH_NUMERIC+1] = _J("\0"); /* Retrieve the string value of the job number */ FormatMathNumeric(szJobNumber, &lpDS->mnJobnumber);
To retrieve the string value of a MATH_NUMERIC data type in ZCHAR format, use the jdeMathGetRawString API function. This example illustrates the use of this function:
/* Declare variables */ ZCHAR zzJobNumber[MAXLEN_MATH_NUMERIC+1] = _Z("\0"); /* Retrieve the string value of the job number */ zzJobNumber = jdeMathGetRawString(&lpDS->mnJobnumber);
Another commonly used MATH_NUMERIC API function is jdeMathSetCurrencyCode. This function is used to update the currency code member of a MATH_NUMERIC data structure. Two versions of this function exist: jdeMathCurrencyCode and jdeMathCurrencyCodeUNI. The jdeMathCurrencyCode function is used to update the currency code with a ZCHAR value, and jdeMathCurrencyCodeUNI is used to update the currency code with a JCHAR value. This example illustrates the use of these two functions:
/* Declare variables */ ZCHAR zzCurrencyCode[4] = _Z("USD"); JCHAR szCurrencyCode[4] = _J("USD"); /* Set the currency code using a ZCHAR value */ jdeMathSetCurrencyCode(&lpDs->mnAmount, (ZCHAR *) zzCurrencyCode); /* Set the currency code using a JCHAR value /* jdeMathSetCurrencyCodeUNI(&lpDS->mnAmount, (JCHAR *) szCurrencyCode);