iOS 将金钱变为逗号形式

int value = 200000;
NSNumberFormatter * formatter = [NSNumberFormatter new];
[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
NSString * newString =  [formatter stringFromNumber:[NSNumber numberWithInteger:value]];

 

int aNum = 2000000;
    NSString *display = [NSNumberFormatter localizedStringFromNumber:@(aNum)
                                                         numberStyle:NSNumberFormatterDecimalStyle];

 

posted on 2015-02-08 19:38  Hai_阔天空  阅读(368)  评论(0编辑  收藏  举报

导航