NSNumberFormatter customize?

Posted by Frederick C. Lee on Stack Overflow See other posts from Stack Overflow or by Frederick C. Lee
Published on 2012-09-13T21:32:35Z Indexed on 2012/09/13 21:38 UTC
Read the original article Hit count: 326

Filed under:
|

I wish to use NSNumberFormatter to merely attached a percent ('%') to the supplied number WITHOUT having it multiplied by 100.

The canned kCFNumberFormatterPercentStyle automatically x100 which I don't want.

For example, converting 5.0 to 5.0% versus 500%.

Using the following:

NSNumberFormatter *percentFormatter = [[NSNumberFormatter alloc] init];
[percentFormatter setNumberFormat:@"##0.00%;-##0.00%"];

But 'setNumberFormat' doesn't exist in NSNumberFomatter.

I need to use this NSNumberFormatter for my Core-Plot label.

How can I customize NSNumberFormat?

Ric.

© Stack Overflow or respective owner

Related posts about cocoa-touch

Related posts about cocoa