Hi
I have a number like so: 4.47778E+11
Can anyone give me a way of converting that into its number representation easily in c#?
Thanks
Hi
I have a number like so: 4.47778E+11
Can anyone give me a way of converting that into its number representation easily in c#?
Thanks
string s = "4.47778e+11";
double d = double.Parse(s);
or
string s = "4.47778e+11";
if (double.TryParse(s,out d))
{
// number was parsed correctly
}
or for internationalization
double.Parse("4.47778e+11", System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture);
Try this MSDN thread. It's called scientific notation by the way, and a quick google normally solves simple issues.
That's assuming you mean parsing from a string to a float, your question & title are conflicting
Use Convert:
double value = Convert.ToDouble("4.47778E+11");