Double to string conversion without scientific notation

前端 未结 17 1326
無奈伤痛
無奈伤痛 2020-11-22 15:33

How to convert a double into a floating-point string representation without scientific notation in the .NET Framework?

\"Small\" samples (effective numbers may be of

17条回答
  •  悲哀的现实
    2020-11-22 16:03

    i think you need only to use IFormat with

    ToString(doubleVar, System.Globalization.NumberStyles.Number)
    

    example:

    double d = double.MaxValue;
    string s = d.ToString(d, System.Globalization.NumberStyles.Number);
    

提交回复
热议问题