11

I searched and could not find this answer...

If I have this, how can I get it to display the final % symbol? It just omits it in my label.

[NSString stringWithFormat:@"Tries %i%", tries];
Jesse
  • 891
  • 1
  • 13
  • 22

1 Answers1

29

I thought I could contribute a bit and share this comprehensive list of options. Jesse is right!

In my case, the following does the trick!

[NSString stringWithFormat:@"Progress: %.2f%%", progress*100] 
// progress is float ranging 0.0-1.0, 
//and I would like it to print up to 2 decimal point

Happy coding!

Q8i
  • 1,767
  • 17
  • 25