Skip to content

Instantly share code, notes, and snippets.

@avanish
Created February 2, 2017 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avanish/36d4d0ce6be102e4244c8442320ebb21 to your computer and use it in GitHub Desktop.
Save avanish/36d4d0ce6be102e4244c8442320ebb21 to your computer and use it in GitHub Desktop.
Currency Formatter for Nepali Rupees
// Convert the currency format: 1,000,000 to Rs.10,00,00
//
// Initialization
NSNumberFormatter *currencyFormatter = [[NSNumberFormatter alloc] init];
[currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[currencyFormatter setCurrencySymbol:@"Rs."];
[currencyFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_IN"]];
NSString *str = [currencyFormatter stringFromNumber:[NSNumber numberWithFloat:price]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment