One way to get the desired result is to use it String.Formatas follows:
double x = 20.0e-6;
string y = string.Format("{0:0.######}",x);
Console.WriteLine(y);
According to your example, this yields a value 0.00002
EDIT
I just realized that this is actually the opposite of your question, so in order to keep the answer useful, I will add the following:
Given a string, you can parse as double, and then apply the same logic as above. This is probably not the most elegant solution, but it offers another way to get the desired result.
string x = "20.0e-6";
var y = double.Parse(p);
Console.WriteLine(String.Format("{0:0.######}",y));
source
share