You say that with "Rs 0.009" you get a different value. This value is 0.00899999999999999999, by chance? If so, you are actually getting the correct result. Chalk this to an inaccuracy floating point.
Here is the code that shows this:
NSString* str = @"Rs 0.009"; NSNumberFormatter *_currencyFormatter = [[NSNumberFormatter alloc] init]; [_currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle]; [_currencyFormatter setCurrencyCode:@"INR"]; [_currencyFormatter setLenient:YES]; [_currencyFormatter setCurrencySymbol:@"Rs"]; NSLog(@"\n With Currency : %@",str); NSLog(@"\n Without Currency : %@",[_currencyFormatter numberFromString:str]); NSLog(@"\n Without Currency : %f",[[_currencyFormatter numberFromString:str] floatValue]); NSLog(@"\n Without Currency : %.03f",[[_currencyFormatter numberFromString:str] floatValue]);
source share