Developer/iOS

[iOS]숫자 세자리마다 콤마 (,) 추가하기

블로blow 2013. 8. 22. 14:30
728x90



    NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
    [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle];

    NSString *price = [NSString stringWithFormat:@"%@원", [numberFormatter stringFromNumber:[NSNumber numberWithInt:obj.amount]]];

    [numberFormatter release];

728x90