title: Convert a number from stringstream to string with a set precision
body: <p>I would like to obtain a number from stringstream and set it to 5 significant figures. How do I do this? So far, this is what I have managed to come up with:</p>
  
  <pre><code>double a = 34.34566535
  std::stringstream precisionValue;
  precisionValue.precision(6) &lt;&lt; a &lt;&lt; std::endl;
  </code></pre>
  
  <p>However, this is not compiling. Thanks.</p>