• 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 (Velocityboy)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Displaying '%' in the UI (Velocityboy)
      • From: Preston Sumner <email@hidden>
    • Re: Displaying '%' in the UI (Velocityboy)
      • From: Lee Ann Rucker <email@hidden>
  • Prev by Date: Re: Updating NSMenu while it's open
  • Next by Date: Guidelines on using NSJSONSerialization
  • Previous by thread: How can I prevent UITableViewRowAnimationAutomatic to slide down my UISearchBar?
  • Next by thread: Re: Displaying '%' in the UI (Velocityboy)
  • Index(es):
    • Date
    • Thread