• 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: NSNumberFormatter separator issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSNumberFormatter separator issue


  • Subject: Re: NSNumberFormatter separator issue
  • From: Chris Kane <email@hidden>
  • Date: Fri, 30 Mar 2007 09:05:39 -0700

I believe this is a known bug in Tiger and previous OS releases. Try this experiment: instead of "the user" typing in '1000', type in '1,000', and see what happens. If the same thing as in step 5 occurs, then this bug is known. The problem is that AppKit tends to send the formatted output back into the formatter as input, perhaps several times on ending editing (is the caret blinking in the text field in step 3?), AND the old style pre-10.4 NSNumberFormatter does not like getting the thousands separator in input, though it'll format it into the output fine.

When you drag the number formatter off the IB palette, you're getting a pre-10.4 NSNumberFormatter.


Chris Kane Cocoa Frameworks, Apple


On Mar 30, 2007, at 8:30 AM, Keith Blount wrote:

Hi,

Many thanks for your reply. The version of the OS where this is an issue is 10.4.9 and earlier.

And in general, if this is 10.4+ why are you explicitly setting the
the separator rather than using a given style (which will adopt the
user's preference)?

Hmm, this is interesting. I'm self-taught, so maybe I am missing something stupid. The way I set the formatter is by dragging the number formatter onto the text field in IB. I then set it to the 100, 0, -100 style and select to show separators. If I just drag the number formatter on without changing it, I get decimal places, which I don't want. What do you mean by using a "given style"? There does seem to be a bug in Tiger here, though.


Many thanks again for your reply and help.
All the best,
Keith

----- Original Message ----
From: mmalc crawford <email@hidden>
To: Keith Blount <email@hidden>
Cc: email@hidden
Sent: Friday, March 30, 2007 12:46:51 AM
Subject: Re: NSNumberFormatter separator issue


On Mar 29, 2007, at 2:40 PM, Keith Blount wrote:

1. The user enters, say, 1000, and clicks okay.
2. Everything is fine - the target word count is set to 1000.
3. The user opens up the sheet containing the text field. The text
field reads, "1,000" - that is, it shows the comma thousands
separator, as it should.
4. Without changing anything, the user clicks, "OK" to confirm.
5. Now, the "1,000" gets changed to "1". It is as though the number
formatter reads the comma for decimal point, even though the
formatter placed the comma there in the first place.

What version of the OS are you using?
How did you configure the formatter?
What is the current locale?

And in general, if this is 10.4+ why are you explicitly setting the
the separator rather than using a given style (which will adopt the
user's preference)?

mmalc



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >Re: NSNumberFormatter separator issue (From: Keith Blount <email@hidden>)

  • Prev by Date: Converting WebView to JPEG
  • Next by Date: Re: Converting WebView to JPEG
  • Previous by thread: Re: NSNumberFormatter separator issue
  • Next by thread: Re: NSNumberFormatter separator issue
  • Index(es):
    • Date
    • Thread