开发者

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

开发者 https://www.devze.com 2023-03-09 19:29 出处:网络
This question already has answers here: 开发者_JAVA百科Closed 11 years ago. Possible Duplicate: How to add percent sign to NSString
This question already has answers here: 开发者_JAVA百科 Closed 11 years ago.

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?


You should double the percent sign (%%).

0

精彩评论

暂无评论...
验证码 换一张
取 消