C# convert Numbers to Exponential form in specific format

98 Views Asked by At

I want to use the string formatter to present decimal value with combination value which is int and exp without lost any information of the double. Example:

12,35 => 1235 exp -2
12,359 => 12359 exp -3
123,5967 => 1235967 exp -4 
130 => 13 exp 1
1300 => 13 exp 2

I tried to use

string.Format("{0:######E0}", value)

But this add additional 0 values into the int number value:

12,35 => 12350000 exp -6. But I want to be 12345 exp -2 

Can you give me some suggestion how I can pass my examples?

0

There are 0 best solutions below