title: Formatting a numeric vector: Aligning to decimal points
body: <p>Given a numerical vector I want to convert it to a character vector given a maximum with of usable characters.</p>
  
  <pre><code>x = c(2, 0.002, 0.2)
  x
  # [1] 2.000 0.002 0.200
  </code></pre>
  
  <p>The print method for example works quite as I want the formatting to be. If the space is not sufficient or the other way around it should behave as follows:</p>
  
  <pre><code>myFormat(x, width = 4)
  # "2.00" "0.00" "0.20"
  myFormat(c(2, 0, 0.2), width = 4)
  # " 2.0" " 0.0" "0.2"
  </code></pre>
  
  <p>Is there a simple way to do this with <code>prettyNum</code>, <code>formatC</code> or some other way?</p>