title: C++ long long to string conversion fails
body: <p>I have the following function which has to convert numbers of any size to strings:</p>
  
  <pre><code>string NumberToString(long long number) {
      ostringstream NumberInStream;
      NumberInStream.str("");
      NumberInStream.clear();
      NumberInStream &lt;&lt; setprecision(0);
      NumberInStream &lt;&lt; fixed &lt;&lt; number;
      return NumberInStream.str();
      }
  </code></pre>
  
  <p>The function works very well for numbers of maxlength: 9.</p>
  
  <p>So for example when I input a 10-digit long number, e.g. 1234567890 it returns wrong format.</p>
  
  <p>Some examples:</p>
  
  <ul>
  <li>1494978929 became 1494978944</li>
  <li>1494979474 became 1494979456</li>
  <li>1494979487 became 1494979456</li>
  <li>1494979498 became 1494979456</li>
  <li>1494979500 became 1494979456</li>
  <li>1494979529 became 1494979584</li>
  <li>1494979540 became 1494979584</li>
  </ul>
  
  <p>However, </p>
  
  <ul>
  <li>2 became 2</li>
  <li>120 became 120</li>
  <li>44567 became 44567</li>
  <li>456.45 became 456 because of setprecision(0)</li>
  </ul>