I have a program that calculates some user input, and I would like to show it as a percent. I just need to know how to put the '%' symbol in my code without it crashing on me.
Using,
lblUserTypedName.text = [[NSString alloc] initWithFormat: @"%2.1f", ultimate_risk];
Prints out a number, like 18.4. I would like for it to print out 18.4%. I've tried the following
lblUserTypedName.text = [[NSString alloc] initWithFormat: @"%2.1f%", ultimate_risk];
and it doesn't print the '%' symbol. I've tried the following.
lblUserTypedName.text = [[NSString alloc] initWithFormat: @"%2.1f\%\", ultimate_risk];
with no luck.
What am I missing here?