QXXPTOI() — Convert Packed Decimal to Integer
Format
#include <xxcvt.h>
int QXXPTOI(unsigned char *pptr, int digits, int fraction);
Language Level
ILE C Extension
Threadsafe
Yes
Description
The QXXPTOI function converts a packed decimal number to an integer.
Example
#include <xxcvt.h>
#include <stdio.h>
int main(void)
{
unsigned char pptr[10];
int digits = 3, fraction = 0, value = 104, result;
/* First convert an integer to a packed decimal,*/
QXXITOP(pptr, digits, fraction, value);
/* then convert it back to an integer. */
result = QXXPTOI(pptr, digits, fraction);
/* result = 104 */
}
Related Information
- QXXDTOP() — Convert Double to Packed Decimal
- QXXDTOZ() — Convert Double to Zoned Decimal
- QXXITOP() — Convert Integer to Packed Decimal
- QXXITOZ() — Convert Integer to Zoned Decimal
- QXXPTOD() — Convert Packed Decimal to Double
- QXXZTOD() — Convert Zoned Decimal to Double
- QXXZTOI() — Convert Zoned Decimal to Integer