Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNumberFormatters and [] characters



Hi,

I've been asked to display negative currencies in the app I'm writing in red with [Dr] after them. It didn't make much sense to me (apparently Dr stands for debit record) but it is consistent with the way the same information is displayed on the website, so I'll go along with it. I'm using an NSNumberFormatter to format the currencies, which was fine back when I was indicating negative numbers with the negative sign. But now that I try to enter [Dr] in the negative format, either in IB or in code, the [ and ] disappear. I've read the documentation on format string syntax, which has no mention of any special meaning for those two characters, and says:

All other characters specified in a number format string are displayed as typed.

Is this a bug? If so, is it a bug in NSNumberFormatter, or just a bug in the documentation? Does anyone know if there is a way of getting [ and ] to appear? I've tried [[ and \[ to no avail.
--
Angela Brett
email@hidden
http://NSCoder.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.