网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  How to not show unnecessary zeros when given integers but still have float answers when needed

How to not show unnecessary zeros when given integers but still have float answers when needed

分类: IT文章 • 2022-04-26 20:13:40

    NSString *str = [NSString stringWithFormat:@"%g",12.10];

    NSLog(@"str = %@",str);

输出:

str = 12.1

http://stackoverflow.com/questions/19667918/how-to-not-show-unnecessary-zeros-when-given-integers-but-still-have-float-answe

http://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关推荐

  • How to not show unnecessary zeros when given integers but still have float answers when needed
  • How to not show unnecessary zeros when given integers but still have float answers when needed
  • CocoaPods详解之----使用篇 一、什么是CocoaPods 二、安装CocoaPods 三、使用CocoaPods 四、参考资料
  • 破解Revealapp的试用时间限制 转载自:http://jingwei6.me/2014/02/28/reveal_crack.html
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号