float floattemp=0;

float.TryParse(kf, out floattemp) true则是数字,false则不为数字

控制小数点位数

 strLength = floattemp.ToString().Split('.');

strTemp = strLength[1];
if (strTemp.Length > 2)
{
err += "高考总分小数点后部分超过2位;";
}

相关文章:

  • 2022-12-23
  • 2021-05-23
  • 2022-03-06
  • 2021-12-19
  • 2021-11-11
  • 2021-06-02
  • 2022-02-05
猜你喜欢
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案