0

I am trying to get an exact percentage for certain parts of my app to two decimal places (73.38%), but no matter what I do, it rounds it to (73.00%). What is going on with this code?

NSInteger acceptedCount = objects.count;
NSString *inStr = [NSString stringWithFormat: @"%ld", (long)acceptedCount];
needvisiting.text = [inStr stringByAppendingString:@" Need Visiting"];
float precentage = (100 * acceptedCount)/self.homesVisited;
VisitedPercent.text = [NSString stringWithFormat:@"%2.2f%%",precentage];
Nicolas Miari
  • 16,006
  • 8
  • 81
  • 189
user717452
  • 33
  • 14
  • 73
  • 149

0 Answers0