title: Convert double to string using boost::lexical_cast in C++?
body: <p>I' d like to use <code>lexical_cast</code> to convert a float to a string. Usually it works fine, but I have some problems with numbers without decimal. How can I fix number of decimal shown in the string?</p>
  
  <p>Example:</p>
  
  <pre><code>double n=5;
  string number;
  number = boost::lexical_cast&lt;string&gt;(n);
  </code></pre>
  
  <p>Result number is <code>5</code>, I need number <code>5.00</code>.</p>