简体   繁体   中英

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

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM