PC Review


Reply
Thread Tools Rate Thread

Convert double value 1.7E+20 to 1.722222222222222222222.

 
 
VijayRama
Guest
Posts: n/a
 
      11th May 2010
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
 
Reply With Quote
 
 
 
 
Andrew Morton
Guest
Posts: n/a
 
      11th May 2010
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


 
Reply With Quote
 
Family Tree Mike
Guest
Posts: n/a
 
      11th May 2010


"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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert double value 1.7E+20 to 1.722222222222222222222. VijayRama Microsoft C# .NET 4 11th May 2010 04:48 PM
Convert Double to Int =?Utf-8?B?U3R1bXBlZA==?= Microsoft C# .NET 4 5th Sep 2004 08:35 PM
Convert to double ruca Microsoft ASP .NET 1 23rd Feb 2004 10:07 AM
Convert to double ruca Microsoft ADO .NET 1 23rd Feb 2004 10:07 AM
Convert from VBA double to NET double Henke Microsoft C# .NET 1 8th Oct 2003 02:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:35 PM.