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