title: Convert Double to NSString for label text
body: <p>I'm trying to get an <code>NSNumber</code> out of an <code>NSMutableArray</code> that's been previously manipluated as a <code>double</code> and then added to the array to print out in a label (<code>NSString</code>).</p>
  
  <p>It's important that the number stays as an accurate representatoin of a double with no scientific notation to abbreviate the answer.</p>
  
  <p>The other requirement is to have it print to maybe 15 or 16 decimal places, rounding is optional but not required.</p>
  
  <p>I also do not want trailing 0's when displaying the <code>double</code></p>
  
  <p>I've tried the following but these do not work...</p>
  
  <p>This is ok but ends the number with a . (eg: <code>1+1=2.</code>)</p>
  
  <pre><code>double test = [[data.argOperands objectAtIndex:0]doubleValue];
  label.text = [NSString stringWithFormat:@"%3.2f", test];
  label.text = [label.text stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"0"]]];
  </code></pre>
  
  <p>I then try something like this, which is wrong because if I do 9^99 it'll print <code>inf</code> or 0.0003/4 it'll give scientific numbers instead of the value</p>
  
  <pre><code>    float y = [[calcData.argOperands objectAtIndex:0]doubleValue];;
      label.text = [NSString stringWithFormat:@"%g", y];
  </code></pre>
  
  <p>If I do the following using double it's getting close, 9^99 works, but 3.33/5 returns 0.666000 with trailing 0's</p>
  
  <pre><code>    double y = [[data.argOperands objectAtIndex:0]doubleValue];
      label.text = [NSString stringWithFormat:@"%f", y];
  </code></pre>
  
  <p>Any code examples of how to do it this way using either <code>NSNumberFormatter</code> or <code>NSDecimalNumber</code> would be greatly appreciated.</p>