Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

' % ' symbol was not printing on objective-c [duplicate]

Tags:

objective-c

Possible Duplicate:
How to add percent sign to NSString

I am trying to print red (10.0 %) in Objective-C using the statement:

    $ newlabel1.text= [[NSString alloc] initWithFormat:@"red (%.1f %)",rv];

However, I am getting red(10.0) only, and the % symbol was not printing. How can I make the percentage symbol print?

like image 526
naresh Avatar asked Jun 02 '11 10:06

naresh


1 Answers

You should double the percent sign (%%).

like image 79
patapizza Avatar answered Nov 15 '22 08:11

patapizza