Convert double value 1.7E+20 to 1.722222222222222222222.

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
0
VijayRama
5/11/2010 2:53:02 PM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

4 Replies
793 Views

Similar Articles

[PageSpeed] 18

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
0
Peter
5/11/2010 3:25:55 PM
try:

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

/LM

"VijayRama" <vijay3491@gmail.com> wrote in message 
news:f80fec7b-cf98-4aba-8af1-524ef33db354@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 


0
Luc
5/11/2010 3:28:38 PM
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".
0
Harlan
5/11/2010 3:46:34 PM

"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
0
Utf
5/11/2010 3:48:01 PM
Reply:

Similar Artilces:

double sided printing
At our office we have a printer that does double sided printing. We are trying to set up our reports to print out double sided. The problem that we seem to be having is that Excel treats each worksheet as a new print job and therefore we can not seem to find a way to get Excel to print one worksheet on one side of the page and the next worksheet on the other side. If you have two pages in one worksheet then you can get those to print double sided but the problem there is that Excel then assigns these two pages the same page number. So my question is this... Is there any way to get ...

"empty" picklist value
Hi All, I'm trying to create a picklist which has an empty element. This could be used whether the user does not know which value fit to the data. Eg. I'd like to create a picklist with the values: " ",Black, White, Yellow. I'm not able to do this becasue a value should not be empty. Have anyone feced to the same problem? Is there a sophisticated solution? Thanks. Why not just use the value "unknown"? Matt Parks MVP - Microsoft CRM ---------------------------------------- ---------------------------------------- On Wed, 6 Apr 2005 05:43:05 -0700, "...

ComboBox
Hi. I'm an ASP.NET developer working on an Access application. In ASP.NET I'm used to a dropdownlist's DataTextField property (text that displays in the control) and DataValueField property (the value tied to each text item). In Access, how can I set both a text and value property to a combobox? Specifically I have a ComboBox control that I need to have display text field "UserName" and have a value named "UserID". Is this possible? I am using a combobox's rowsource to write the select statement which populates the combobox. Can I set both a text...

How do I access page 2 on my newsletter? Page 1 completed
Using publisher for the first time. I completed page 1 but can't figure out how to get to page 2 of the 4 page newsletter form that I chose. SuzyBB wrote: > Using publisher for the first time. I completed page 1 but can't > figure out how to get to page 2 of the 4 page newsletter form that I > chose. =============================== There should be tabs at the bottom of your project that allow you to select the page. If you are using Publisher 2003 or earlier... go to...View / Status Bar. If you are using Publisher 2007...have a look at the following article: Where is the ...

convert .mdb to .mde
how to convert the extension .mdb to .mde and what's the use of this? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200707/1 You do the conversion under Tools | Database Utilities. The point is that it locks the design of forms, reports and modules so that your users cannot change them. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "mroks via AccessMonster.com" <u35438@uwe> wrote in message news:74c272c7245fa@uwe... > how to convert the extension .mdb to .mde a...

Resetting values in a dialogue box
Hi, I need to do screen shots of the Cross-Reference dialogue box for a demonstration. I need the listbox under "Reference type" to only contain items (figures, headings, captions) that have been added for the document I am working on. My problem is that under the reference type, the options include all the captions that I have used throughout all other documents I worked with with since the Word 2007 application was launched. Is there some way to erase Word's cache of reference types without rebooting the computer? I will be doing a presentation and will not be able to ...

Negative value in Excel
I would like value in a certain rage of cells to always be negativ without adding minus sign when enter the value. Does anyone know how t set this??? Many thanks -- Message posted from http://www.ExcelForum.com Adhanya, One solution is to put the values in straightaway (as positive), and simply make them look as though they're negative. Select the cells, Format, Cells, Number, Custom, and use something like: -General -0.00 Then in any formulas that refer to them, negate them so they will be treated as negative. Or an event macro can negate them as they're entered. -- Earl Kios...

Dec 12 SECURITY UPDATE to version 11.3.1 to patch vulnerabilities
I saw the the update posted on versiontracker.com at: http://www.versiontracker.com/dyn/moreinfo/macosx/14980 Rather than download at that site, I updated by going under Entourage's Help pulldown menu to "Check for Updates." As I noted in my comments on the versiontracker.com site: 11.3.0 installed without incident after I had quit out of all Office programs. Version numbers: Entourage updated from 11.2.5 to 11.3.1 but both Word and Excel remained at 11.3.0. No issues whatsoever in putting Entourage, Excel and Word through their paces. It would be nice if there never wer...

help needed to add values with conditions
Hi, I have some data N O P Q TD (Y/N) Value VAT Total Val Y £71.44 £10.72 £82.16 4 N £71.44 £10.72 £82.16 5 N £84.08 £12.61 £96.69 6 Y £84.08 £12.61 £96.69 N £102.85 £15.43 £118.28 N £34.22 £5.13 £39.35 N £0.00 £0.00 £0.00 N £0.00 £0.00 £0.00 N £0.00 £0.00 £0.00 N £84.08 £12.61 £96.69 N £84.08 £12.61 £96.69 Y £84.08 £...

do u know about Excel tool that would convert figures into words
kindly let me know about a tool that converts figures into words in excel How to Convert a Numeric Value into English Words http://support.microsoft.com/default.aspx?scid=KB;EN-US;q140704&; -- Gary's Student "Jagesh" wrote: > kindly let me know about a tool that converts figures into words in excel > See http://www.xldynamic.com/source/xld.xlFAQ0004.html -- HTH RP (remove nothere from the email address if mailing direct) "Jagesh" <Jagesh@discussions.microsoft.com> wrote in message news:A95E4013-F5BF-46B6-9CBF-9536FA715164@microsoft.com......

Click on graph bar to execute a double-click in a pivot table cell
Excel 2002. I have a group of 6 different stacked bar charts built from parts of a pivot table. Each graph has several bars with each bar having sections for categories "10", "20", "30", "40", and "50". The graphs can be direct linked to the pivot table (as a pivot chart) or linked to an intermediate sheet looksup the data from the pivot table. I want to be able to click (double or single click) on a graph bar or section of a bar and execute the same action (.ShowDetail) that occurs when you double-click on a cell in the pivot table (print th...

Find more than 1 @ in email
blabla@hotmail.com@gmail.com How to use query to find email address field that contain more than 1 @ sign like one above? Thanks. Use criteria like the following against the email address field. LIKE "*@*@*" John Spencer Access MVP 2002-2005, 2007-2009 The Hilltop Institute University of Maryland Baltimore County Song Su wrote: > blabla@hotmail.com@gmail.com > > How to use query to find email address field that contain more than 1 @ > sign like one above? > > Thanks. Song Su wrote: >How to use query to find email address fi...

Auto-expiring excel cell values
Hi! Does anybody know how to make cell values "disapear" after a predetermined date? I would like to share an excel (I must send it by email), but only for a limited amount of time! This shouldn't be visible to the recipient of the worksheet! Thanks Hi Alberto! I don't think that there are any easy ways but you can make life difficult. You could use conditional format: Formula Is: =DATE(2003,12,30)+14<TODAY() Format the font color the same as the background color. Don't forget to use: Format > Cells > Protection Check Hide OK Tools > Protection > P...

CRM 1.0 Server License
I have a client that has been running CRM 1.0 and isn't sure if a server license was required back then or if they have a license for it now. Are they grandfathered in with the server license for 1.2 and 3.0? If they are current with the software assurance, then they will be able to upgrade their licenses free of charge. There were server licenses for v1.0 as well. -- Matt Parks MVP - Microsoft CRM "Brian Jones" <BrianJones@discussions.microsoft.com> wrote in message news:6D497654-5EE8-4C80-9305-088798DA25C8@microsoft.com... I have a client that has been runnin...

"Converted failed to open the file" error
Hello, I have a .net code that uses ExcelPackage to generate server-side Excel 2007 spreadsheets. Basically, ExcelPackage is a wrapper aorund the Open XML format. http://excelpackage.codeplex.com/ My code is as follows Imports OfficeOpenXml Dim newfilePath As String = "C:\Upload\Test.xlsx" Using xlpackage As ExcelPackage = New ExcelPackage(newFile) xlpackage.Workbook.Styles.Fonts(0).Bold = True xlpackage.Workbook.Styles.Fonts(0).FontName = "Arial" xlpackage.Workbook.Styles.Fonts(0).Size = Convert.ToString(9) xlpackage.Workbook.Styles.Fonts(0).Color = ...

Copy/Paste Values code
Is there a faster way to copy and paste one entire worksheets data into another existing worksheet? I do NOT want to rename the sheets. Code below is what I'm using now but it seems that there should be a simpler way. Thanks! Sub CopySheets() Sheets("Sheet2").Select Cells.Select Selection.Copy Sheets("Sheet1").Select Range("A1").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False End Sub Give this a try... Sub...

Copy Color Formats Based On Column Date Values
I currently have this code, where HMLoc is the starting point for a color paste at C6. Instead of having this a constant field, I need it to search for today's date in the cell above it (C5) (The dates are given in the range C5:BO5), and then color accordingly. I have struggled with this all morning and can't get it to work the way I want it. Please help me! Option Explicit Const LegendLoc = "BH3" Const HMLoc = "C6" Const None = 0 Sub ColorHM() Dim theRow As Integer Dim theCol As Integer Dim NumX As Single Dim Color1 As Integer Dim Color2 As Integer Dim Color3 A...

Not accept a value of 0 in a currency field.
In a cost savings field I want to not accept a savings of 0, but a cost of less than or greater than 0 is acceptable. In my projects database there is a cost saving field and the engineers are getting around it by putting in a 0 so I want to force them to put in an acceptable value. for example the savings might be $1.99 or ($1.99) but not $0.00. How can i do that. in the validation rule property of your field put <>0 "Leslie" wrote: > In a cost savings field I want to not accept a savings of 0, but a cost of > less than or greater than 0 is acceptable. In my ...

each message enters repeatede 20 times !!!!!
Every time I get a message on my e-mail account of window live mail , enters repeated 20 times o more. If I delete them, re-enter. No matter where you send. My email is filled with so many messages. How I can stop them? ...

Converting to PDF Newer Version Message
I just started using Publisher to create our Newsletter and convert it to a PDF for my users. They are complaining that it pops up the message "This document was created with a newer version of Adobe Acorbat". They can continue to view the document with the version they have, but we don't want them to receive this message since it's causing confusion and we don't have a newer version to offer them. Is there a way to prevent this message? Thanks! Lauren, When I create PDFs with Adobe Acrobat 6 Pro, I am offered a choice for the level created. Secondly, the free...

Macro to add value if cell has a color :-s
I don't know if this exists, but is it possible to check if a certain cell has a color? Normally a cell is blank, but someone asked me to see if it is possible to check if a cell is colored.. Any suggestions? Thanks!!! Is this sufficient? Sub ifcolor() If Range("b2").Interior.ColorIndex > 0 Then MsgBox "yep" End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com <test@testnospam.nl> wrote in message news:obht5456aq6ur5gbqmasacqke9p2g13o7i@4ax.com... >I don't know if this exists, but is it possible to check if a cer...

Schedule K-1
Does any version of Microsoft Money handle Schedule K-1 of S Corporations? >Does any version of Microsoft Money handle Schedule K-1 of S Corporations? As far as I can tell, Small Business doesn't .... (just bought it recently) By "handle" do you mean (a) that you are using Money for an S-Corp and want a report showing the K-1 items or (b) that you want to record the amounts shown on a K-1 for a shareholder that uses Money? I don't know on (a). For (b), using Money Deluxe 2004, I am not aware of a specific function that allows direct input from tax forms (inclu...

converting numeric date into aphabets
is this possible or any forumal, that can convert date into alphabets. like if i have in a1 is 30.06.2006 or 30/06/2006, so in b1 i can get thirty mayor(or sixth), two sound six. cant found any where, any reference. help. thanx.. -- doom4 ------------------------------------------------------------------------ doom4's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=35926 View this thread: http://www.excelforum.com/showthread.php?threadid=557211 Hi You could create 2 named ranges using Insert>Name>Define> One would be called Days and would look li...

converting from ms access 2003 to 2007
I teach a database course and I've been using the same databses for a couple of years for lab exercises. I have had no success converting them to v2007. Where are detailed instructions for this, esp. w/ regard to macros and VBA code? -- jkm A good source of information specifically about Access 2007 is Jeff Conrad's http://www.accessjunkie.com He's also got links to other good Access 2007 sites. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "jkm" <jkm@discussions.microsoft.com> wrote in message news:DCA33FDA-9AD...

Need Help on Matching a value from a list of values
This is my formula: =IF(Data!B2:B21=K54,"ZONE2","ZONE1") and k54=PINE AND PINEL is found IN THE RANGE B2:B21 ;however, this fromula return ZONE1 Can some one help me? Thank -- Message posted from http://www.ExcelForum.com One way: =IF(ISNA(MATCH(K54,Data!B2:B21,FALSE)),"ZONE1","ZONE2") another: =IF(COUNTIF(Data!B2:B21,K54),"ZONE2","ZONE1") In article <nespa.19412i@excelforum-nospam.com>, nespa <<nespa.19412i@excelforum-nospam.com>> wrote: > This is my formula: =IF(Data!B2:B21=K54,"ZONE2&qu...