• 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: number formatting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: number formatting


  • Subject: Re: number formatting
  • From: Lance Bland <email@hidden>
  • Date: Fri, 22 Feb 2002 16:45:49 -0500

On Friday, February 22, 2002, at 03:56 PM, email@hidden wrote:

Um... nobody has done anything about it because it's not regarded as a bug, would be my guess. :-> Modularity of design is good. If you want your value formatted, use an NSFormatter. If you want a cheaper solution, use setStringValue: and format the string yourself. But building in code in NSTextfield that lets you set things like the precision, the exponent format, etc. would be an exceedingly bad design, IMHO.

This is how I would implement it:

Define a shared number formatter for all text fields. That will work for, say, 90% of the cases, if not more. Then I wouldn't have to create all sorts of little number formatters (big waste of memory).

For the rare case make me drag a NSNumberFormatter from IB palette to the text field.

That solution would also save on my wrist as I drag out hundreds of formatters for no reason at all besides the fact that the default behavior is useless.

I haven't looked into this problem in years because we make our own formatters, so maybe something has changed and I can enable a default behavior after all. If that is the case I'd like to know it.

-lance

_______________________________________________
Lance Bland
System Administrator at VVI
mailto:email@hidden
http://www.vvi.com
Realtime, bulk and web data reporting and visualization
_______________________________________________
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.

  • Follow-Ups:
    • Re: number formatting
      • From: email@hidden
References: 
 >Re: number formatting (From: email@hidden)

  • Prev by Date: Re: seconds into hours ?
  • Next by Date: Re: incompatible pointer type (was: Please help?)
  • Previous by thread: Re: number formatting
  • Next by thread: Re: number formatting
  • Index(es):
    • Date
    • Thread