private double ChangeDataToD(string strData)
{
decimal dData = 0.0M;
try
{
if (strData.Contains("E") || strData.Contains("e"))
{
strData = strData.Substring(0, strData.Length - 1).Trim();
dData = Convert.ToDecimal(Decimal.Parse(strData.ToString(), System.Globalization.NumberStyles.Float));
}
else
{
dData = decimal.Parse(strData);
}
}
catch (Exception)
{
dData = 0;
}
return double.Parse(dData.ToString());
}
C# 将科学记数法转换为小数
最新推荐文章于 2024-07-17 10:58:54 发布