Function _conGetNDF() Foundation

Reads the value and the default format of a numeric container.

Syntax
XPPAPIRET _conGetNDF(ContainerHandle chn, double *ndValue
                     LONG *intDigits, LONG *decDigits);
Parameters
ContainerHandle chn
Handle of a container with a numeric value.
double *ndValue
Pointer to a buffer of double type into which the value of the numeric container is to be written.
LONG *intDigits
Pointer to a buffer into which the desired number places to the left of the decimal point is to be written. If the number of places to the left of the decimal point is not defined the furnished value is negative.
LONG *decDigits
Pointer to a buffer into which the desired number of places to the right of the decimal point is to be written.
Return

The function returns an error code (XPP_ERR_...) when the container chn is not of numeric type. If the return value is NULL the operation was successful.

Description

The function _conGetNDF() returns the value of a container of numeric type, along with information about the desired formatting for output of this value. The returned number of places before and after the decimal point give no information about the actual values before and after the decimal point.

Examples
/* 
Determines the value and the format of a numeric container. 
*/ 
#include <xppcon.h> 
#include <stdio.h> 
ContainerHandle  chNumeric; 
LONG             nIntgDigits, nDecDigits; 
XPPAPIRET        xr; 
double           ndValue; 

/* Assigns a value to ... hNumeric */ 

xr = _conGetNDF(hNumeric, &ndValue, &nIntgDigits, &nDecDigits); 
if (xr == 0) 
{ 
/* Output of the value of the number in the default format:  */ 
printf(buffer,"%*.*f\n", nIntgDigits, nDecDigits, ndValue); 
} 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.