• 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
Formatting int/float/double to Sci Notation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Formatting int/float/double to Sci Notation


  • Subject: Formatting int/float/double to Sci Notation
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Tue, 9 Apr 2002 15:27:53 -0700

Greetings:
How can I format a number like '0.000123' which is stored as a double value into scientific notation {1.23e-4} to a NSTextField (hence displayed as such)? Very small numbers come out as zero(0).

Is there a formatter pattern that translates a number to its equivalent sci notation? Or must I convert the simple scaler into a NSDecimalNumber and proceed from there?

Would using the NSTextField's Delegate be useful in something like this: Converting numbers < 0.001 to sci notation; and number > 123456 as sci notation?

Thanks.

Ric.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: "Space" key equivalent for menu items
  • Next by Date: Re: Can I do something when double click on a button?
  • Previous by thread: Re: Can I do something when double click on a button?
  • Next by thread: -keep_private_externs defined?
  • Index(es):
    • Date
    • Thread