How do I convert a string to a float in Objective-C?
I am trying to multiply a couple of strings I am getting back from JSON:
float subTotal = [[[[pu
The proper way of doing this is
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; numberFormatter.numberStyle = NSNumberFormatterDecimalStyle; float value = [numberFormatter numberFromString:@"32.12"].floatValue;