Convert double array to string array with formatting
int okutil_convert_double_vector_to_string_vector( DoubleArray * pdaDoubles, StringArray * psaStrings, UINT nSize, StringArray * psaFormats = NULL )
Number of converted items
EX1
void okutil_convert_double_vector_to_string_vector_ex1() { vector<string> strVec; vector<double> dVec = {1.113,0.786,3,-2.097,10.894,2.168,0,8.123}; vector<string> fVec = {"*1","*2","*3","*4","*5","*6","*7","*8"}; int nRet = okutil_convert_double_vector_to_string_vector(&dVec , &strVec ,8,&fVec ); if(nRet) { printf("%d items converted :\n" , nRet);//Output: 8 items converted : 1 0.79 3.00 -2.097 10.894 2.16800 0.000000 8.1230000 for(int ii = 0; ii < strVec.GetSize() ; ii++) printf("%s " , strVec[ii]); printf("\n"); } else printf("Convert failed"); }
convert_double_vector_to_string_vector,
origin.h