I am using the following code snippet to format numbers in an iPad project using UIKit.h, but I can’t figure out how to make negative numbers show as red. What I’ve tried, based on the documentation, isn’t working. Would appreciate some suggestions on this.
NSNumberFormatter *decimalStyle = [[[NSNumberFormatter alloc] init] autorelease];
[decimalStyle setFormatterBehavior:NSNumberFormatterBehavior10_4];
[decimalStyle setNumberStyle:NSNumberFormatterDecimalStyle];
[decimalStyle setPositiveFormat:@"###,###,##0"];
[decimalStyle setNegativeFormat:@"(###,##0)"];
At the moment you cannot do that directly, what you can do is something like this: