开发者

How to convert non-Exponential numbers to Exponential number in c#

开发者 https://www.devze.com 2022-12-12 05:00 出处:网络
we have some calculation in our project like convertion from non-Exponential(\"1234567890.1234567890\" numbers to Exponential(\"1.234567890E+10\") number.

we have some calculation in our project like convertion from non-Exponential("1234567890.1234567890" numbers to Exponential("1.234567890E+10") number.

is there any solution for above issue?

开发者_运维知识库

please help me to come out from this problem.


It seems like you need to use Double.Parse (if you have the number as a string) and then Double.ToString with the appropriate format specifier. For example: number.ToString("E")


Use this.

string.Format("{0:#.0#E-00}", NumericValue);

or

string.Format("{0:E}", NumericValue);
0

精彩评论

暂无评论...
验证码 换一张
取 消