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: Andrew Morton on
VijayRama wrote:
> 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#?

What's the rule for converting it?

It looks like, given

a.bE+cd

you want

a.bcccccccccccccccccc

where c is repeated cd times.

Is that correct?

--
Andrew


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
> .
>

Since those two numbers are not equivalent, how do you want the conversion
to work? Ignoring that problem, x.ToString("f0") may be what you want.

Mike