可以做这样的事情:
double myValue = 0.000007812345d;
string myValueAsString = myValue.ToString("F20");
Console.Out.WriteLine(myValueAsString);
其中F20指定您要输出一个小数点后20位十进制数字的定点输出。请参阅https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings
稍后,如果您需要将字符串值转换回double值,则可以执行以下操作:
double myConvertedValue = Double.Parse(myValueAsString);
Console.Out.WriteLine(myConvertedValue); // note that this string is treated with scientific notation
仅当原始double变量超出范围时,才需要执行此操作。否则,只需使用原始的double进行计算等。