07-18-2014 03:35 PM
Hello,
I am creating a custom log file by reading all numeric values for all tests. The double values as reported by TestStand and viewable in built-in reports look like this:
9.255963134932e+061
Here's CVI code that I use to read them:
sprintf(keyName,"Locals.ResultList[%d].Numeric",i);
tsErrChk(TS_PropertyExists(seqContextCVI, &errorInfo,keyName, 0, &propertyExists));
if(propertyExists){
tsErrChk(TS_PropertyGetValNumber(seqContextCVI,&errorInfo,keyName,0,&numproperty));
sprintf(szBuf,"%.5lf",numproperty);
}
What I get in my report is this:
92559631349317830736831783200707727132248687965119994463780864.00000
Any ideas?
Thanks
CT
Solved! Go to Solution.
07-21-2014 10:44 AM
Hello Cimteker,
In line, "sprintf(szBuf, "%.5lf".......",you specifiy szBuf should be written with 5 numbers of precision, which is why your report displays 5 zeros. To log the values in scientific notation, you should change the formatting of sprintf to "%e".
07-21-2014 02:46 PM
Thanks Haley.
Actually "%.5g" is even a better choice. If you use "%.5e" than 0 is reported as 0.0000E+00. G makes it all nice.
Thanks for help
CT