4

From the following two - double precision - numbers:

123456
0.0003232

I need to get (at least one decimal place) ...

123456.0   (one decimal place added)
0.0003232  (same as above)

... and never scientific notation, like E+000. The more close result from standard string.Format() is string.Format("{0:F1}", myDoubleVal) but in the second case the decimals are lost.

What else can I try?

Thanks.

abenci
  • 8,422
  • 19
  • 69
  • 134

1 Answers1

12

Try the below

string.Format("{0:0.0###########}",myval);

Thanks

Sethu
  • 236
  • 2
  • 5