On Apr 19, 2012, at 6:57 AM, Kirk Kerekes wrote:
>
> On Apr 18, 2012, at 2:00 PM, cocoa-dev-requ...@lists.apple.com wrote:
>
>> Re: Displaying '%' in the UI (Velocityboy)
>
> As a possibly more clear alternative to escaping the %, you could use:
>
> [NSStr
>(trusting NSNumber's -description method for formatting)
description is for NSLog etc. If you get in the habit of using it for things
you display to users, you'll have some unpleasant surprises.
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
On Apr 18, 2012, at 2:00 PM, cocoa-dev-requ...@lists.apple.com 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
To put a literal % in a format, use %%.
On Apr 17, 2012, at 12:03 PM, The Rhythmic wrote:
> A trivial question, but not able to get to it. How am I to display '%'
> (percentage symbol) in the UI? Here is the code snippet, where am trying to
> set '%' to the end of a number (something like '100%')
A trivial question, but not able to get to it. How am I to display '%'
(percentage symbol) in the UI? Here is the code snippet, where am trying to
set '%' to the end of a number (something like '100%'). But, '100' is
getting displayed in the button's text, but how do I make it display the
'%' symbo