title: Formatting a string containing a number with comma separation
body: <p>I have a number stored in an <code>NSMutableString</code> instance which I want to auto format with comma delimiters and then display the result in a <code>UITextField</code>.</p>
  
  <p>I've tried using <code>NSNumberFormatter</code> to format as currency, but I don't want it to show decimals if the original <code>NSMutableString</code> doesn't contain a decimal place.</p>
  
  <p>For example:</p>
  
  <ul>
  <li>If the <code>NSMutableString</code> contains "1234567", it should format as "1,234,567".</li>
  <li>If the <code>NSMutableString</code> contains "1234567.1", it should format as "1,234,567.1"</li>
  <li>If the <code>NSMutableString</code> contains "1234567.12", it should format as "1,234,567.12"</li>
  </ul>
  
  <p>The maximum decimals that the <code>NSMutableString</code> will contain is 2.</p>
  
  <p>Any help is greatly appreciated.</p>
  
  <p>Thanks!</p>