标签: objective-c
我想知道如何格式化浮点数。
Float Want to display 1.0 1 1.52 1.5 1.58 1.6
答案 0 :(得分:5)
格式字符串@"%.1g"会这样做吗?
@"%.1g"