I have one string with a currency symbol and currency formatted… I want to convert it into normal string..
My Code is like this..
-(NSString *)removeCurrency:(NSString *)str{
NSNumberFormatter *_currencyFormatter = [[NSNumberFormatter alloc] init];
[_currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[_currencyFormatter setNegativeFormat:@"-¤#,##0.00"];
NSLog(@"\n With Currency : %@",str);
NSLog(@"\n Without Currency : %@",[_currencyFormatter numberFromString:str]);
return [NSString stringWithFormat:@"%@",[_currencyFormatter numberFromString:str]];
}
But problem is there when I enter the string Rs 0.009 it return me different values but with another number it works perfect …