0

I want to parse "7.7E-07" string into double so it looks like: "0.00000077" But none of the methods that I've found on the internet work. This is my code:

double someNumber = double.Parse("7.7E-07", NumberStyles.Float, CultureInfo.InvariantCulture );

and it still produce '7.7E-07'

Chiro
  • 47
  • 1
  • 8
  • And you not re-convert it to another string like `someNumber.ToString("R")`? (similar one: https://stackoverflow.com/questions/611552/c-sharp-converting-20-digit-precision-double-to-string-and-back-again) – Tetsuya Yamamoto Jul 19 '17 at 06:25
  • When you debug your code, and look at the content of `someNumber` it is shown as `7.7E-07`? Hard to believe – Romano Zumbé Jul 19 '17 at 06:25
  • Your issue isn't with the parsing of the string, but in fact the opposite: going from `double` to `string`. See linked duplicate – Rob Jul 19 '17 at 06:25
  • You first have to parse as double, then use ToString() to change to your output. double someNumber = double.Parse("7.7E-07"); someNumber.ToString("0:0.00000000") – jdweng Jul 19 '17 at 06:31

0 Answers0