C# 将Double值截取小数点后两位

可写为

string str=douRate.ToString("0.00");

如返回为double型也可以

 double dou=double.Parse(douRate.ToString("0.00"));

当然了也可以用 Math.Round方法

decimal result = Math.Round(douRate,2); 后面的2表示保留小数点后2位小数

原文地址:https://www.cnblogs.com/hailexuexi/p/2455410.html