Objective Grid: Displaying double precision values in ODBC and ADO grids

Article ID: 552
Last updated: 16 Apr, 2018
Article ID: 552
Last updated: 16 Apr, 2018
Revision: 3
Views: 1551
Posted: 09 Jan, 2001
by Meltreger B.
Updated: 16 Apr, 2018
by Meltreger B.

Problem


Numeric Values in ODBC and ADO with double precision are only displayed with 7 digits.


Cause


The problem is ODBC Grid and ADO Grid call printf() with the %.g format mask.


Action


To fix the problem, search for the case for double precision and change the printf() format string.

Example: (for ODBC)
 

case AFX_RFX_DOUBLE:
if (*(double*) pv != AFX_RFX_DOUBLE_PSEUDO_NULL)
{
_stprintf(strRet.GetBuffer(MAX_NUM_STRING_SIZE), _T(%.13g), *(double*)pv);

strRet.ReleaseBuffer();

}
break;


 
 

This article was:   Helpful | Not helpful
Report an issue
Article ID: 552
Last updated: 16 Apr, 2018
Revision: 3
Views: 1551
Posted: 09 Jan, 2001 by Meltreger B.
Updated: 16 Apr, 2018 by Meltreger B.

Others in this category