• 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: Thousands separators added to number fields
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thousands separators added to number fields


  • Subject: Re: Thousands separators added to number fields
  • From: Charles Srstka <email@hidden>
  • Date: Sat, 11 Aug 2012 00:01:28 -0500

On Aug 10, 2012, at 4:06 PM, James Merkel <email@hidden> wrote:

> Ok, I could do it that way also.
>
> Jim Merkel
>
> On Aug 10, 2012, at 1:28 PM, Kyle Sluder <email@hidden> wrote:
>
>> On Fri, Aug 10, 2012, at 01:17 PM, James Merkel wrote:
>>>> As of 10.8, it looks like thousands separators are automatically added to numbers displayed in text boxes.
>>>> Can this be disabled? In some places it doesn't make sense like in a display of a year.
>>>
>>> Ok, I see from:
>>> https://developer.apple.com/library/mac/#releasenotes/CoreFoundation/CoreFoundation.html
>>> that +[NSString localizedStringWithFormat:] which I am using now adds the
>>> thousands separators. I don't see a way around this.
>>
>> Aside from attaching an NSNumberFormatter to the text field?
>>
>> --Kyle Sluder

Using an NSNumberFormatter on the text field is the *correct* way to do this. Then, you can customize the display to whatever you like, and you can be sure it will stay that way even if the implementation of (localized)StringWithFormat: changes.

Charles
_______________________________________________

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

References: 
 >Re: Thousands separators added to number fields (From: James Merkel <email@hidden>)
 >Re: Thousands separators added to number fields (From: Kyle Sluder <email@hidden>)
 >Re: Thousands separators added to number fields (From: James Merkel <email@hidden>)

  • Prev by Date: Re: Cocoa-dev Digest, Vol 9, Issue 569
  • Next by Date: Re: 32-bit on 10.8
  • Previous by thread: Re: Thousands separators added to number fields
  • Next by thread: Re: Thousands separators added to number fields
  • Index(es):
    • Date
    • Thread