title: Convert float to std::string in C++
body: <p>I have a float value that needs to be put into a <code>std::string</code>. How do I convert from float to string?</p>
  
  <pre><code>float val = 2.5;
  std::string my_val = val; // error here
  </code></pre>