• 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
NSNumberFormatter and printf-style %g ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNumberFormatter and printf-style %g ?


  • Subject: NSNumberFormatter and printf-style %g ?
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 2 Jun 2010 17:25:21 -0400
  • Organization: Rogue Research Inc.

Hi all,

Is there a way to make NSNumberFormatter work like printf's %g ?

That is, "print a double in either normal or exponential notation,
whichever is more appropriate for its magnitude."

As best as I can tell from the docs the answer in no.

I know about NSNumberFormatterScientificStyle, but it seems
unconditional.  ex: I'll get "5E0" instead of just "5".  I'd like
numbers like 5 to appear as "5" and numbers like 0.0000005 to appear as 5E-7.

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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

  • Prev by Date: Re: Access ObjC class from PyOBJC
  • Next by Date: Re: Mail Frameworks
  • Previous by thread: Re: Access ObjC class from PyOBJC
  • Next by thread: CFAttributedString and NSDATA
  • Index(es):
    • Date
    • Thread