title: How to specify decimal places when formatting NSNumber objects?
body: <p>I'm using the following piece of Objective-C code to format a NSNumber, and it works fine most of the time, but it doesn't quite do what I want when the NSNumber object holds an integer (no fractional part).</p>
  
  <pre><code>UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(80.0f, 90.0f, 225.0f, 40.0f)];
  label.backgroundColor = [UIColor clearColor];
  label.textColor = [UIColor whiteColor];
  NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
  [formatter setNumberStyle:NSNumberFormatterDecimalStyle];
  [formatter setFormat:@"###.##"];
  int bytes = 1024 * 1024;
  NSNumber *total = [NSNumber numberWithFloat:([self.totalFileSize floatValue] / bytes)];
  label.text = [NSString stringWithFormat:@"0.00 MB of %@ MB", [formatter stringFromNumber:total]];
  </code></pre>
  
  <p>So for instance, if <code>self.totalFileSize</code> holds 55.2300, it will display "55.23" as it should on my <code>UILabel</code>. But if that same variable holds 55, it will simply display "55" on the label.</p>
  
  <p>What I really want is for this code to always include the 2 decimal places in the output.</p>
  
  <p>How can I achieve that?</p>