Function _conPutNDF() Foundation

Assigns a floating point number with a predefined format to a container or produces a new numeric container.

Syntax
ContainerHandle _conPutNDF(ContainerHandle ch, double nfValue
                           LONG intDigits, LONG decDigits);
Parameters
ContainerHandle ch
Handle of any container or NULLCONTAINER.
double nfValue
New numeric value of the container.
LONG intDigits
Number of desired places to the left of decimal point for output of the value. To indicate that no places to the left of the decimal are desired, pass a -1 for this argument.
LONG decDigits
Number of desired places to the right of the decimal point for output of the value.
Return

Returns either the passed container handle or the container handle of the newly created container. The return value is NULLCONTAINER if an error occurs.

Description

_conPutNDF() is used to assign a numeric value with a predefined output format to a container. This function is needed with databases which define a specified format for numeric values. When the passed container handle has the value NULLCONTAINER, a new numeric container is created. Otherwise the value of the passed container is changed.

When a new container is created, it must be released with _conRelease() as soon as it is no longer needed.

Examples
/* 
Returns a floating point number with a specified number of places to 
the right of the decimal point as a return value to Xbase++. 
*/ 
#include <xppcon.h> 

ContainerHandle  hNumeric; 
double           nfValue; 
LONG             nDecDigits; 

/* ... Calculates nfValue and nDecDigits */ 

hNumeric = _conPutNDF(NULLCONTAINER, nfValue, -1, nDecDigits); 
if (hNumeric != NULLCONTAINER) 
{ 
_conReturn(<pList>, hNumeric); 
_conRelease(hNumeric); 
} 
else 
{ 
/* Error occurred: return NIL. */ 
_conReturn(<pList>, NULLCONTAINER); 
} 

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.