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 ho
You might be better off with localizedStringWithFormat, like so...
[UILabel alloc] initWithFrame:CGRectMake(80.0f, 90.0f, 225.0f, 40.0f)];
label.backgroundColor = [UIColor clearColor];
label.textColor = [UIColor whiteColor];
int bytes = 1024 * 1024;
label.text = [NSString localizedStringWithFormat:@"0.00 MB of %.2f MB", ([self.totalFileSize floatValue] / bytes)];
And of course, bytes could be a const unsigned, and clearColor tends to be a performance hog, but those are issues for another thread.