• 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: Why does default NSDateFormatter in IB ignore thousands separator?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does default NSDateFormatter in IB ignore thousands separator?


  • Subject: Re: Why does default NSDateFormatter in IB ignore thousands separator?
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 02 Nov 2016 11:10:00 -0700
  • Feedback-id: 167118m:167118agrif8a:167118s7ctJ1ngZn:SMTPCORP

On Nov 2, 2016, at 09:58 , Sean McBride <email@hidden> wrote:
>
> The "localize format" checkbox is checked by default; the tooltip for that checkbox says thousands separators should be applied.

> In 'System Preferences > Language&Region > Advanced > General' there is a setting to choose the thousands separator, mine is set to 'space'.
>
> Why on Earth does a default NSNumberFormatter ignore the user's choice?  Am I alone thinking this is buggy?

Going from memory, I think I ran into this too, once. IIRC, the problem is that one of the necessary parameters (e.g. the separator character, the number of digits per group) doesn’t default to the system settings, so that the formatter *would* show the grouping but it thinks it can’t.

FWIW, here’s the code I use to get a formatter to show separators (not via IB, obviously), but this combination of non-default parameters works, at least:

> 		formatter = [[NSNumberFormatter alloc] init];
> 		formatter.formatterBehavior = NSNumberFormatterBehavior10_4;
> 		formatter.usesGroupingSeparator = YES;
> 		formatter.locale = [NSLocale currentLocale];
> 		formatter.groupingSize = 3;

(The fact that I did this in code may also reflect the fact that I gave up trying to do it in IB.)

The fact that the IB file seems to say there’s no grouping may not be significant. IB may have figured out that one required setting is missing, so disabling the grouping completely might be an effect, not a cause.

_______________________________________________

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


  • Follow-Ups:
    • Re: Why does default NSDateFormatter in IB ignore thousands separator?
      • From: Sean McBride <email@hidden>
References: 
 >Why does default NSDateFormatter in IB ignore thousands separator? (From: Sean McBride <email@hidden>)

  • Prev by Date: Re: Crash in addSubview: when compiled with SDK > 10.9
  • Next by Date: Re: How to ResolvingSymlinksInPath ?
  • Previous by thread: Why does default NSDateFormatter in IB ignore thousands separator?
  • Next by thread: Re: Why does default NSDateFormatter in IB ignore thousands separator?
  • Index(es):
    • Date
    • Thread