c# 判断字符串是否为数字
时间:2014-11-05 16:51:19
收藏:0
阅读:172
float floattemp=0;
float.TryParse(kf, out floattemp) true则是数字,false则不为数字
控制小数点位数
strLength = floattemp.ToString().Split(‘.‘);
strTemp = strLength[1];
if (strTemp.Length > 2)
{
err += "高考总分小数点后部分超过2位;";
}
评论(0)