How to not show unnecessary zeros when given integers but still have float answers when needed
2014-04-11 18:54 三戒1993 阅读(110) 评论(0) 编辑 收藏 举报NSString *str = [NSString stringWithFormat:@"%g",12.10];
NSLog(@"str = %@",str);
输出:
str = 12.1
http://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html
版权声明:本文为博主原创文章,未经博主允许不得转载。