@ riad1986 -
Not math wiz but I would use…
Microsoft sample for you to look at
http://msdn.microsoft.com/en-us/library/c309e6c9(v=vs.110).aspx
Sorry but link is bad…
Microsoft code
public void ConvertDoubleString(double doubleVal) {
string stringVal;
// A conversion from Double to string cannot overflow.
stringVal = System.Convert.ToString(doubleVal);
System.Console.WriteLine("{0} as a string is: {1}",
doubleVal, stringVal);
try {
doubleVal = System.Convert.ToDouble(stringVal);
System.Console.WriteLine("{0} as a double is: {1}",
stringVal, doubleVal);
}
catch (System.OverflowException) {
System.Console.WriteLine(
"Conversion from string-to-double overflowed.");
}
catch (System.FormatException) {
System.Console.WriteLine(
"The string was not formatted as a double.");
}
catch (System.ArgumentException) {
System.Console.WriteLine(
"The string pointed to null.");
}
}
I think you really wanted this?
http://msdn.microsoft.com/en-us/library/ds4kkd55(v=vs.110).aspx
Paste link into explorer click link does not work