C#限制float有两位小数

string str = (float.Parse(recode)).ToString("f2");//recode是string类型

posted @ 2017-10-10 11:35  千喜ya  阅读(1285)  评论(0编辑  收藏  举报