How to convert NSString value @"3.45" into float. 3.45
float fCost = [[NSDecimalNumber decimalNumberWithString:@"3.45"]floatValue] ;
NSString *val = @"3.45";
float fCost = [val floatValue];
float number = [string floatValue];
NSString's: - (float)floatValue;
For example:
NSString *str = @"3.45";
float f = [str floatValue];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With