" Live as if you were to die tomorrow. Learn as if you were to live forever.. "
- Mahatma Gandhi

Converting integer values to the values which have comma delimiters

Posted on November 23rd, 2015 by Divya Arora

If we have an integer value say 123456789 to display the price of some commodity and we need to display it in the format like 123,456,789 then we can use NSNumberFormatter and then set its number style. NSNumberFormatter has the following number Styles:     kCFNumberFormatterNoStyle, kCFNumberFormatterDecimalStyle, kCFNumberFormatterCurrencyStyle, kCFNumberFormatterPercentStyle, kCFNumberFormatterScientificStyle, kCFNumberFormatterSpellOutStyle.   We can set […]