UILabel
を小数点以下にしたいと思っていますが、最も近いものに四捨五入しています。コードは次のとおりです。NSStringは+2.50にしようとすると最も近い整数に丸めます
int currentTime = [totalPrice.text intValue];
int newTime = currentTime + 2.50;
totalPrice.text = [NSString stringWithFormat:@"%d.00", newTime];
私は間違っていますか?
P.S. StackOverflow上で役立つ他の記事が見つかりませんでした。
ありがとうございました! –