c语言float、double数据保留2位小数
时间:2018-09-26 18:48:53
收藏:0
阅读:665
float sp = 36.51647; sp=( (float)( (int)( (sp+0.005)*100 ) ) )/100;
挺实用的。double也可以。
原文:https://www.cnblogs.com/airduce/p/9708795.html
评论(0)