title: How to print output with a set amount of spaces in C++
body: <p>I'm trying to print numbers out with a set amount of spaces in front of the numbers, like this:</p>
  
  <pre><code>     123
       456.789
       9.342
  </code></pre>
  
  <p>I've tried <code>std::setw()</code> but it does not print out with the set amount of whitespace that I'd like because my numbers are varying in length. Is there a function in C++ that can accomplish what I need?</p>
  
  <p>Thank you!</p>