title: How to use "%f" to populate a double value into a string with the right precision
body: <p>I am trying to populate a string with a double value using a <code>sprintf</code> like this:</p>
  
  <pre><code>sprintf(S, "%f", val);
  </code></pre>
  
  <p>But the precision is being cut off to six decimal places. I need about 10 decimal places for the precision.</p>
  
  <p>How can that be achieved?</p>