Closed. This question is off-topic。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗? Update the question,所以它是on-topic,用于堆栈溢出。
                        
                        6年前关闭。
                                                                                            
                
        
数字值是120000。


项目清单
   这个数字值我需要显示1,20,000。

最佳答案

您可以使用NSNumberFormatterCurrencyStyle获得所需的结果。

NSNumberFormatter *indCurrencyFormatter = [[NSNumberFormatter alloc] init];
[indCurrencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[indCurrencyFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_IN"]];
NSString *formattedString =  [indCurrencyFormatter stringFromNumber:[NSNumber numberWithFloat:120000]];

关于ios - 如何在iOS中以逗号分隔显示数字值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20395491/

10-11 08:31