strCal 文字列 strcal 値からの式は @"((24 - 18) / 87) * 100" です。結果を 10 進数 4 に修正したいので、floatValue メソッドを使用して結果を取得します。
しかし、6.8966 の代わりに 0 を取得します
これは私のコードです
NSString *strCal=[NSString stringWithFormat:@"
((%d%@)%@)%@",number,strMinus,strDivide,strMultiple];
NSExpression *exp=[NSExpression expressionWithFormat:strCal];
float result=[[exp expressionValueWithObject:nil context:nil] floatValue];
NSLog(@"result:%f",result);
結果:0.000000