title: Padding a number with zeros
body: <p>How do I represent a number <code>user.id</code> as a string with:</p>
  
  <ul>
  <li><p><code>00</code> padded to the left if <code>user.id</code> is in range 0 to 9</p>
  
  <p><code># =&gt; "00#{user.id}"</code></p></li>
  <li><p><code>0</code> padded if <code>user.id</code> is in range 10 to 99</p>
  
  <p><code># =&gt; "0#{user.id}"</code></p></li>
  <li><p>nothing padded otherwise</p>
  
  <p><code># =&gt; "#{user.id}"</code></p></li>
  </ul>
  
  <p>For example, having <code>user.id = 1</code>, it would produce <code>"001"</code>, having <code>user.id = 11</code>, it would produce <code>"011"</code>, and having <code>user.id = 111</code>, it would produce <code>"111"</code>.</p>