Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to format the number with commas in iPhone programing

I want to format the number separated by comma for every 3 digits. For ex:12346778, I want this number as 12,346,778 Can anyone please Suggest sample code for this. Thanks in Advance.

like image 934
Madan Mohan Avatar asked Dec 17 '22 12:12

Madan Mohan


1 Answers

NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];  
[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
like image 65
Swapna Avatar answered Dec 19 '22 01:12

Swapna