title: Number to string with fixed length
body: <p>Is there a function in the standard library that would work like <code>std::to_string</code>, but with a fixed length?</p>
  
  <pre><code>std::cout &lt;&lt; formatted_time_string &lt;&lt; ":" &lt;&lt; std::to_string(milliseconds) &lt;&lt; " ... other stuff" &lt;&lt; std::endl;
  </code></pre>
  
  <p>In the example above, milliseconds would range from 1 to 3 digits and therefore the output would be improperly formatted. </p>
  
  <p><em>I know there are a lot of other options how to do this (e.g. <code>sprintf</code>, calculating the length etc.), but an inline option would be nice to have.</em> </p>