Created
September 22, 2013 06:50
-
-
Save Duraiamuthan/6657383 to your computer and use it in GitHub Desktop.
objective c format number as comma added currency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSNumberFormatter *currencyFormatter = [[[NSNumberFormatter alloc] init] autorelease]; | |
[currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle]; | |
double d2 = 3432.89; | |
NSString *strCurrency = [currencyFormatter stringFromNumber:[NSNumber numberWithDouble:d2]]; | |
NSLog(@"%@", strCurrency); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment