Convert double value 1.7E+20 to 1.722222222222222222222.

  • Thread starter Thread starter VijayRama
  • Start date Start date
V

VijayRama

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
 
VijayRama said:
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
 
VijayRama said:
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".
 
VijayRama said:
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
 
Back
Top