Re: Displaying '%' in the UI (Velocityboy)
Re: Displaying '%' in the UI (Velocityboy)
- Subject: Re: Displaying '%' in the UI (Velocityboy)
- From: Kirk Kerekes <email@hidden>
- Date: Thu, 19 Apr 2012 07:57:56 -0500
On Apr 18, 2012, at 2:00 PM, email@hidden wrote:
> Re: Displaying '%' in the UI (Velocityboy)
As a possibly more clear alternative to escaping the %, you could use:
[NSString stringWithFormat:@"%.0f%@",ratio1, @"%"]
Or, even more cocoa-fied ObjC:
[NSString stringWithFormat:@"%@%@",[NSNumber numberWithFloat: ratio1], @"%"]
(trusting NSNumber's -description method for formatting)
or,
[NSString stringWithFormat:@"%ul%@",[[NSNumber numberWithFloat: ratio1] integerValue], @"%"]
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden