From: VijayRama on
Hi All,

I have double value 1.7E+20. I need to convert it and show it in
textbox as below

1.722222222222222222222.

how do we convert it? do we have any formats (string.format) in C#?

Thanks in Advance
From: Peter Duniho on
VijayRama wrote:
> Hi All,
>
> I have double value 1.7E+20. I need to convert it and show it in
> textbox as below
>
> 1.722222222222222222222.

1.7E+20 isn't even close to 1.722222222222222222222, at least not by
floating point standards. Why do you want the latter when given the former?

> how do we convert it? do we have any formats (string.format) in C#?

First link searching for "numeric string format" on MSDN:
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx

The second link is this one:
http://msdn.microsoft.com/en-us/library/0c899ak8.aspx

Pete
From: Luc E. Mistiaen on
try:

Console.WriteLine ("{0:F0}", 1.7E+20) ;

/LM

"VijayRama" <vijay3491(a)gmail.com> wrote in message
news:f80fec7b-cf98-4aba-8af1-524ef33db354(a)31g2000prc.googlegroups.com...
> Hi All,
>
> I have double value 1.7E+20. I need to convert it and show it in
> textbox as below
>
> 1.722222222222222222222.
>
> how do we convert it? do we have any formats (string.format) in C#?
>
> Thanks in Advance


From: Harlan Messinger on
VijayRama wrote:
> Hi All,
>
> I have double value 1.7E+20. I need to convert it and show it in
> textbox as below
>
> 1.722222222222222222222.
>
> how do we convert it? do we have any formats (string.format) in C#?

The notation 1.7E+20 means 170 000 000 000 000 000 000 (170 quintillion,
following the US convention). E+20 doesn't mean "repeat the digit 2
twenty times", it means "multiply by 10 to the twentieth power".
From: Family Tree Mike on


"VijayRama" wrote:

> Hi All,
>
> I have double value 1.7E+20. I need to convert it and show it in
> textbox as below
>
> 1.722222222222222222222.
>
> how do we convert it? do we have any formats (string.format) in C#?
>
> Thanks in Advance
> .
>

You have two answers already in microsoft.public.dotnet.general. Both
answers are confused about how you are converting, as the two numbers don't
seem related to each other.

Mike