How to convert double to string without the power to 10 representation (E-05)

后端 未结 4 1650
死守一世寂寞
死守一世寂寞 2020-12-01 16:42

How to convert double to string without the power to 10 representation (E-05)

double value = 0.000099999999833333343;
string text = value.ToString();
Consol         


        
4条回答
  •  日久生厌
    2020-12-01 17:17

    Use String.Format() with the format specifier. I think you want {0:F20} or so.

    string formatted = String.Format("{0:F20}", value);
    

提交回复
热议问题