Given the NSString "1.625", I want to round this to "1.63". How in the world do I do that?
This is what i have now:
NSString *rateString = [NSString stringWithFormat:@"%.2f", [@"1.63" doubleValue]];
NSNumberFormatter * f = [[NSNumberFormatter alloc] init];
[f setNumberStyle:NSNumberFormatterDecimalStyle];
item.rate = [f numberFromString:rateString];;
However, doubleValue converts 1.625 to 1.6249999999 So when I round it to two decimal digits with @"%.2f", I end up with 1.62!