如何删除小数点后的所有字符。
我想要 7 而不是 7.3456。
这就是我为得到带小数位的数字所做的工作。
[NSString stringWithFormat:@" %f : %f",(audioPlayer.currentTime),(audioPlayer.duration) ];
非常感谢, -代码
最佳答案
您可以使用格式字符串指定您想要的内容:
[NSString stringWithFormat:@" %.0f : %.0f", (audioPlayer.currentTime),
(audioPlayer.duration)];
关于iphone - 删除 double 小数点后的字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8581212/