Read numbers from file to two significant digits?
<pre><code>#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;

using namespace std;

int main() {
    ifstream basketFile;
    basketFile.open("basket.txt");

    double price;

    while (!basketFile.eof()) {
        basketFile &gt;&gt; price;
        cout &lt;&lt; price &lt;&lt; endl;
    }

}
</code></pre>

<p>basket.txt</p>

<pre><code>27.9933
18.992
9.754
11.2543
</code></pre>

<p>Anyway I can make the numbers appear to only two significant digits?  Also, if I want to round a number up how would I do that?  For example, if I had the numbers 6.66 and 4.33 I want the 6.66->6.70 and 4.33->4.30.  Any help?</p>
