setting precision
<p>I am starting out here with a simple temperature conversion program from F to C.  I would like the C temperature to round to the 1/10 decimal place.  I have 5 temperature conversions and can manually set the precision for each.  But perhaps this is not a best practice?</p>

<p>The Fahrenheit temperature for location 0 is 55 and to get a Celsius temperature of 12.8 I had to use setprecision(3).</p>

<pre><code>  cout&lt;&lt;"location 1 = "&lt;&lt;location1f&lt;&lt;" F "&lt;&lt;setprecision(3)&lt;&lt;location01&lt;&lt;" C \n";  
</code></pre>

<p>For this second location the Fahrenheit temperature was 44 and the resulting C temp was only 1 digit left of the decimal, so I had to change the precision to 2. </p>

<pre><code>  cout&lt;&lt;"location 2 = "&lt;&lt;location2f&lt;&lt;" F "&lt;&lt;setprecision(2)&lt;&lt;location2c&lt;&lt;" C \n";
</code></pre>

<p>I am using double as my variable type.  Instead of going through and changing the precision for the expected answer, what is the best way to output the C temperature to a single decimal place?</p>
