• 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
NSNumberFormatter and literal spaces
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNumberFormatter and literal spaces


  • Subject: NSNumberFormatter and literal spaces
  • From: "Ben Kennedy" <email@hidden>
  • Date: Wed, 4 Sep 2002 16:50:25 -0400
  • Organization: Zygoat Creative Technical Services

Hi all,

It appears there have been some subtle changes to NSNumberFormatters
under 10.2.

I want to include a literal space in my format string, such that I can
right-justify some figures in a fixed-width font to achieve a display
like this:

135.00
69.35-
0.69
2099.00-

Note how I would like the minus-sign to appear on the right (for negative
numbers), or instead a space (for non-negative numbers).

Here are my format strings:

positive: "#,##0.00 "
negative: "#,##0.00-"
zero: "0.00"

This *used* to work under 10.1, but no longer since I have upgraded to
Jag: it seems the literal space in the format string is now ignored, and
the positive strings are fully right-justified. I have tried option-
space and shift-space to force a non-breaking space, but neither works.

How can I achieve this formatting under 10.2?

thanks,

-ben

--
Ben Kennedy, chief magician
zygoat creative technical services
613-228-3392 | 1-866-466-4628
http://www.zygoat.ca
_______________________________________________
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: NSNumberFormatter and literal spaces
      • From: "Ben Kennedy" <email@hidden>
  • Prev by Date: Re: NSDrawer and preferredEdge
  • Next by Date: Re: NSDrawer and preferredEdge
  • Previous by thread: Re: Build error
  • Next by thread: Re: NSNumberFormatter and literal spaces
  • Index(es):
    • Date
    • Thread