double doubleData= heatData.MaxSampleValue.ToString("0.0000E+0");
众所周知 G7的转换是有精度限制的,所以:
double value1 = 1234.56789;
double value2 = 0.000123456789;
double value3 = 12345678901234567890.123456789;
string formattedValue1 = value1.ToString("G7", CultureInfo.InvariantCulture);
string formattedValue2 = value2.ToString("G7", CultureInfo.InvariantCulture);
string formattedValue3 = value3.ToString("G7", CultureInfo.InvariantCulture);
Console.WriteLine(formattedValue1);
Console.WriteLine(formattedValue2);
Console.WriteLine(formattedValue3);