Convert double value 1.7E+20 to 1.722222222222222222222.

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
 
P

Peter Duniho

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
 
H

Harlan Messinger

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

Family Tree Mike

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top