title: Format string, integer with leading zeros
body: <p>I want to convert an integer value to a string with leading zeroes (if necessary) such that the string has 3 total characters. For example, <code>5</code> would become <code>&quot;005&quot;</code>, and <code>10</code> would become <code>&quot;010&quot;</code>.</p>
  <p>I've tried this code:</p>
  <pre><code>NSString* strName = [NSString stringWithFormat:@&quot;img_00%d.jpg&quot;, i];
  </code></pre>
  <p>This partially works, but if <code>i</code> has the value of <code>10</code>, for example, the result is <code>img_0010.jpg</code>, not <code>img_010.jpg</code>.</p>
  <p>Is there a way to do what I want?</p>