NSNumberFormatter and printf-style %g ?
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