How to add percent sign to NSString
The code for percent sign in NSString
format is %%
. This is also true for NSLog()
and printf()
formats.
The escape code for a percent sign is "%%", so your code would look like this
[NSString stringWithFormat:@"%d%%", someDigit];
Also, all the other format specifiers can be found at Conceptual Strings Articles
If that helps in some cases, it is possible to use the unicode character:
NSLog(@"Test percentage \uFF05");