dc_todouble()

Converts a string in a field to a double-precision floating point variable

Call
#include <vv_doubl.h>
int dc_todouble(stp, datap, dfldp, cvbufp)

UCHAR *stp

Pointer to string with user's field input

PTR datap Pointer to variable to receive converted field input
DFIELDPTR dfldp Pointer to a data field structure
PTR cvbufp Pointer to a data conversion buffer
Returns  
1 Success. This is the only return value for this function
Description

dc_todouble() makes a copy of the field string in the conversion buffer. All embedded blanks and thousands separators are deleted from the buffer, and the resulting string is converted to a double value. The double-precision floating point value is placed in the data variable.

Related Functions

dc_frdouble(), vf_double()

Cautions

The data type must be double, not float.

No error checking is performed on the input string. dc_todouble() assumes that vf_double() has already validated the string.

This function calls atof(). You may have to link the appropriate floating point library for your compiler to resolve atof().


Home Contents Previous Next