getResult returns fewer significant figures than results table

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

getResult returns fewer significant figures than results table

mjlm
Hi there,

I'm working on a macro which gets measurement results via getResult(). The numbers I get in the macro with getResult, however, have fewer decimal places than the ones displayed in the results table when I do the measurement manually.

Obviously, I'd like to have the highest possible precision in my macro. Is there an option somewhere to determine how many significant figures are passed by getResults, or some other solution?

Thanks,
Matt
Reply | Threaded
Open this post in threaded view
|

Re: getResult returns fewer significant figures than results table

jolyon
This is pretty old now, but I had the same problem and found a solution:

value = d2s(getResult("column", row), 9);

This will return the double value from the results table to 9 decimal places as a string. You could then convert it back to a number with e.g: parseFloat(string);