title: Adding conditional leading or trailing zeros
body: <p>I need help conditionally adding leading or trailing zeros. </p>
  
  <p>I have a dataframe with one column containing icd9 diagnoses. as a vector, the column looks like: </p>
  
  <pre><code>"33.27" "38.45" "9.25" "4.15" "38.45" "39.9" "84.1" "41.5" "50.3" 
  </code></pre>
  
  <p>I need all the values to have the length of 5, including the period in the middle (not counting ""). If the value has one digit before the period, it need to have a leading zero. If value has one digit after the period, it need to have zero at the end. So the result should look like this: </p>
  
  <pre><code>"33.27" "38.45" "09.25" "04.15" "38.45" "39.90" "84.10" "41.50" "50.30" 
  </code></pre>
  
  <p>Here is the vector for R: </p>
  
  <pre><code>icd9 &lt;- c("33.27", "38.45", "9.25", "4.15", "38.45", "39.9", "84.1", "41.5", "50.3" )
  </code></pre>