• 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: Is [Red] the only special color for NSNumberFormatter?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is [Red] the only special color for NSNumberFormatter?


  • Subject: Re: Is [Red] the only special color for NSNumberFormatter?
  • From: Fritz Anderson <email@hidden>
  • Date: Mon, 19 May 2008 11:20:03 -0500

On 19 May 2008, at 8:57 AM, email@hidden wrote:

According tohttp://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNumberFormatter_Class/Reference/Reference.html :

****

An even simpler way to cause negative values to be displayed in red is to include the constant [Red] in your format string, as shown in this example:

[numberFormatter setFormat:@"$#,##0.00;[Red]($#,##0.00)"];
****
Can any other colors be used here, or is it just red?
If other colors are allowed, is it a fixed set, or does it automagically create a color from a NSColor class method with the correct name


e.g:

[numberFormatter setFormat:@"$#,##0.00;[DarkGray]($#,##0.00)"];
Would use +[NSColor darkGrayColor].

I'd recommend experimenting. If I had to guess, the color names might be drawn from the "Apple" system color list (go to the Color Picker, click the third item in the tool bar, and select Apple from the Palette: pop-up).


	— F

_______________________________________________

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: 
 >Is [Red] the only special color for NSNumberFormatter? (From: email@hidden)

  • Prev by Date: Re: whether to use NSSavePanel or something else
  • Next by Date: Delegates
  • Previous by thread: Is [Red] the only special color for NSNumberFormatter?
  • Next by thread: whether to use NSSavePanel or something else
  • Index(es):
    • Date
    • Thread