摘要:
Math类 例子:string str = "00080"; 结果:8.0 int n = 0; double temp = 0.0; if(int.TryParse(str,out n)) { temp = n/10.0; } string result = temp.toString("f1"); toString("f2") :保留两个小数,toString("f"): 默认保留两个小数 如果不在toString()中加格式参数,就只能得到:8 有时会引起麻烦一些常用的函数 Math.Ceiling() :取 阅读全文