• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Displaying '%' in the UI
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying '%' in the UI


  • Subject: Re: Displaying '%' in the UI
  • From: Velocityboy <email@hidden>
  • Date: Tue, 17 Apr 2012 22:13:16 -0700

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%'). But, '100' is
> getting displayed in the button's text, but how do I make it display the
> '%' symbol? Please help.
>
>    [button1 setTitle:[NSString stringWithFormat:@"%.0f", ratio1]
>
>                 forState:UIControlStateNormal];
>
>
> Thanks
>
> Priya
> _______________________________________________
>
> 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


_______________________________________________

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

  • Follow-Ups:
    • Cocoa equivalent for SetWindowProperty in Carbon
      • From: Sanjay Arora <email@hidden>
References: 
 >Displaying '%' in the UI (From: The Rhythmic <email@hidden>)

  • Prev by Date: Displaying '%' in the UI
  • Next by Date: Updating NSMenu while it's open
  • Previous by thread: Displaying '%' in the UI
  • Next by thread: Cocoa equivalent for SetWindowProperty in Carbon
  • Index(es):
    • Date
    • Thread