We want to ensure that upto 10 decimal point values are kept while converting a double value to a string.
When we tried %e or %f, it will not keep more than 5 decimal points.
When we tried %.14f, the small values (less than 1.0e-20) are not properly converted to string.
What format string to be used to keep upto 10 decimal points for double values?
Try
%.17gto print with the most appropriate format for the double in question.