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

前提是你 提交于 2019-11-27 14:25:29

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

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

You don't need string.Format(). Just put the right format string in the existing .ToString() method. Something like "N" should do.

How about

Convert.ToDecimal(doubleValue).ToString()

Use string.Format with an appropriate format specifier.

This blog post has a lot of examples: http://blogs.msdn.com/kathykam/archive/2006/03/29/564426.aspx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!