Search code examples
iphonensmutablestring

Formatting a float number inside a Mutable string


I have a couple of floats and they all are stored in a mutable string. But while displaying them it's showing 2011.00000 inspite of 2011 so i want it to format it. Any suggestions.

Thanks


Solution

  • NSString* str = [NSString stringWithFormat:@"%.f", float_number];