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 that uses QXXPTOD()

#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



[ Top of Page | Previous Page | Next Page | Contents | Index ]