[more of a 'c' question really] Converting doubles to strings without getting scientific notation

Hello hello..


I'm using _gcvt in a dialog to display a double, but when it gets
small the string appears in scientific notation 
ie 0.02 become 2e-02 

Is there another conversion routine I can use to prevent this? I have
a not terribly scientific customer who would prefer a straight forward
decimal display.

Thanks




0
thing (10)
1/6/2004 10:08:27 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
463 Views

Similar Articles

[PageSpeed] 30

"Zardoz" <thing@thing.thing> wrote in message
news:122lvvkvicks85nka58iugok64ba0plpem@4ax.com...
> Hello hello..
>
>
> I'm using _gcvt in a dialog to display a double, but when it gets
> small the string appears in scientific notation
> ie 0.02 become 2e-02
>
> Is there another conversion routine I can use to prevent this? I have
> a not terribly scientific customer who would prefer a straight forward
> decimal display.
>

You could look at _ecvt (or _fcvt) and use the data returned indicating the
sign and the position of the decimal point to format the display of the
number.
Alternatively use sprintf to format the number into the string.

HTH

Les


0
l.neilson (18)
1/6/2004 10:46:36 AM
Reply:

Similar Artilces:

Can't get the proper display of a field in my report.
I have 2 tables, both using autonumbers for their primary key. The first table is for contacts (i.e. last name, first name, etc.). The second table is for businesses (business name, etc.) I have a field in my contacts table that has a number format so it can be used as a foreign key for the business table. I then set up the relationship between them & enforced referential integrity. When I run a query, I see the name of the business (after setting up a combo box) - no problem. When I run a report based on that query, a number is displayed (not the business name). Suggestions, pleas...

String Table (VC6 IDE)
I have strings in English language in the "String Table" of my project (myProject.rc). I'm loading them using: CString msg; msg.LoadString(150); Now, I need to internationalise my app. How can I do that? How can I add support for multiple languages? Which is the best way to do that? >I have strings in English language in the "String Table" of my project >(myProject.rc). I'm loading them using: > >CString msg; >msg.LoadString(150); > >Now, I need to internationalise my app. How can I do that? How can I add >support for multiple lang...

Need help getting files from Exchange Server.
We have a computer that had an account on Outlook attached to a Microsoft exchange server. Apparently for the moment, this computer and the server are inextricably tied together. Outlook cannot even be started without logging into the server because information store or whatever is missing. How do you get the information out of the exchange server to wean the computer from it? tom <Spamblocker@ameritech.net> wrote: > We have a computer that had an account on Outlook > attached to a Microsoft exchange server. > > Apparently for the moment, this computer and the > se...

Array Function Question
I have little knowledge of Array Function. I'm updating a spreadsheet developed by someone else. One array formula trying to lookup data in another spreadsheet looks like below: {=SUM(IF([Data]Data!$A$3:$A$70>=DATEVALUE("01/01/2006"),IF(Data]Data!$A$3:$A$70<=DATEVALUE("03/01/2006"),IF(Data]Data!B$1:$AR$1=A5,Data]Data!$B$3:$AR$38))))} I was told to press Ctrl/Shift/Enter to refrsh the data and it worked last time(3 months ago). But this time the cell won't refresh but shows the formula text. The formula should be fine. Did I miss anything to refresh...

How to get TASK_ID field for summary tasks without using Project.a
I know for tasks which are not summary tasks we can get TASK_ID field using statusing web service. But i could nto find any other options than Project web service to get TASK_ID field for summary tasks and the top level project task. Problem of using Project web service is that in my custom sharedpoint web part where we are using PSI web services we get all the data required using Resource and Statusing web service for the logged in resource. But Statusing web service retrieves TASK_ID only for actual tasks and not for summary tasks. Now just to get TASK_ID of summary tas...

CListBox strings not showing up
Hi all I'm using Microsoft Visual C++ .NET (1.1) So I create a dialog window, draw a simple CListBox, create the variable (m_listbox), then do: m_listbox.AddString("hello!"); UpdateData(FALSE); but nothing shows up. Only until I click where "hello!" should be, is the text visible. So that means I inputted correctly, but there must be some aspect I'm missing. It's probably pretty nooby, but help? Hello, Since you are accessing the control directly, remove the call to UpdateData(FALSE). UpdateData(FALSE) updates (or synchronizes) the controls in the dialog...

Another multiple criteria/column question
Ok, first post and pretty much a new user to Excel. I have two sheets that I am working with, trying to recall data from one to the other that meets criteria. In a nutshell: Sheet 1 contains a column of unique values (col A), cols C,D, and E are where I want to insert the formula to find data on Sheet 2. Sheet 2 contains 4 columns, A contains multiple occurrences of each value (from Sheet1, column A), each with its own timestamp in column D. On Sheet1, in column C, I want to find a value on Sheet2 in column A and return the timestamp in column D. I know I can use VLOOKUP for this. =VLO...

Developing a robust database at one co. then using it at another c
Are there any legal implications of using the type of database listed above to perform similar functions for another company? The 2 company's are in 2 totally different industries and the new database will have to be modified to fit the requirements for the industry it is in. The database was developed at the old company. there is no such thing as a robust Jet database. Move to SQL Server if you want to build a solution that will work for the next decade. Jet is and always has been depecrated On Apr 7, 12:14=A0pm, BoaMan10 <BoaMa...@discussions.microsoft.com> w...

Question about SetCurSel()
Hi, I have a combo box control specified with the drop down (not drop list) style. The list box portion of the control is populated with data from a recordset to allow the user to select from a list of pre-loaded items. Or they may choose to type in a new entry. As the user enters data into the edit box portion of the control, the program checks after each keystroke to see if the entry data matches anything currently in the list. If it does, the drop down list appears and the list item closely or exactly matching the data that has been entered is selected and appears in the edit ...

Question on multiple NICs used by Exchange 2003
I have a requirement to bind four virtual SMTP servers to unique IP addresses. The server has four NICs and each IP address is uniquely bound to a virtual SMTP server. I used telnet to confirm that the appropriate virtual SMTP server responds to each assigned IP address. In case you are wondering why I did not use virtual IP addresses- Per Microsoft, the virtual IP address schema will not satisfy our requirement that the same IP address be used for sending (relaying) the e-mail that received it. Their recommendation was to have a NIC for each virtual SMTP server. The problem that I am ex...

Error C2440 cannot convert from void
I got this error a few days ago and after much searching and still stuck on the problem. Any help given will be greatly appreciated. Error 1 error C2440: 'static_cast' : cannot convert from 'void (__thiscall CPage1::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)' The error occurred in this code: BEGIN_MESSAGE_MAP(CPage1, CPropertyPage) //{{AFX_MSG_MAP(CPage1) ON_WM_DESTROY() ON_WM_TIMER() ON_BN_CLICKED(IDC_BUTTON_PROV_ADD, OnButtonProvAdd) ON_BN_CLICKED(IDC_BUTTON_PROV_EDIT, OnButtonProvEdit) ON_BN_CLICKED(IDC_BU...

Any way to load VB persistence in C++?
I've re-written an old VB6 ActiveX control in C++ as a COleControl, duplicated all its properties and functionality, and taken over its old CLSID and ProgID. Now I'm looking for a way to load the old persisted properties in the new C++ control. Our container supports an ASCII persistence mode which implements IPropertyBag. In this mode, the properties that the VB control wrote out via PropertyBag.WriteProperties map right in to my new control's DoPropExchange PX_blah methods. In binary mode though, when CreateControl( ) winds its way down to my DoPropExchange, all the PX_blah me...

time formula question
This formula works great if the ending time is before 0:00. =IF(D21>0,B21/INDIRECT("Sheet1!E"&MAX((A21>=$C$9:$C$11)*(A21<=$E$9:$E$11)* {2;3;4})),"") $C$9:$C$11 is my starting time i.e. 20:00 $E$9:$E$11 is my ending time i.e. 04:30 How can I get this to work if A21 = 20:15? TIA, David Try this: =IF(D21>0,B21/INDIRECT("Sheet1!E"&MAX((($C$9:$C$11<$E$9:$E$11)*(A21>=$C$9:$C$11)*(A21<=$E$9:$E$11)+(($C$9:$C$11>=$E$9:$E$11)*((A21>=$C$9:$C$11)+(A21<=$E$9:$E$11)))*{2;3;4})),"") HTH -- AP "David" <dfizer@r...

Backup MX questions
After nearly a week of downtime for my Exchange2k server a few weeks ago, I have realized the need for a backup MX server, basically someone who can catch my mail when my smtp server is unavailable and then allow me to seemlessly pick it up or deliver it to me when I am back up again. What is the best way to accomplish this? Mike <>< On Tue, 9 Aug 2005 08:41:17 -0500, "Mike Strout" <m i k e s t r o u t @ h o t m a i l . c o m> wrote: >After nearly a week of downtime for my Exchange2k server a few weeks ago, I >have realized the need for a backup MX ser...

copy without space
I copy a cell to another app. and it contains a space. How should I cop from Excel without this space -- Message posted from http://www.ExcelForum.com ...

How to get the handle of a Help file belonging to other process.
Hi all, In my application,I want to change the Index of a HTMLHELP file which belongs to a dialog running in other exe.In order to do this I need to find whether the Help file is open or not & get the handle of that to use HH_DISPLAY_INDEX .Is there any way to do this?? Note: I dont want to use FindWindow() as it is giving rise to some problems in my application.. Thanks in advance ...

Access violation in CDaoQueryDef::Open or CSimpleStringT::GetLength(). VC++ 6.0 app compiled in Visual C++ .NET
Hi, I have a problem using DAO in Visual C++ .net Standard edition. We have an old project created in Visual C++ 6.0 Professional. The projects compiles, links ok (with a lot of warnings telling the DAO-classes are deprecated). The compiled program executes ok until I am about to access the database. Some accesses goes ok, but some are not. It is always the same databse accesses that the program crashes on. The database that I'm using is Access 97. I also have tried converting it to 2000 and 2002. In this function the crash occurs in daocore.cpp: void CDaoQueryDef::Open(LPCTSTR lpszName...

supplier info gets deleted
I have run a report for items in a category in order to organize them into the proper categories & departments I double click the item look up - properties opens - I change the deparment &/or category - OK When I look at these items again - the supplier information is gone - I have to reopen each one and re-enter the supplier! Can anyone tell me why & how to avoid this happening? ALSO in my category report I am finding some suppliers blank - but when I open the properties the supplier is there - I have to delete the supplier & re-add the supplier. Anyone know why &am...

Number Format
Is this available/possible? The difference between engineering and Scientific is that engineering is always in the form of "11.11En where "n" is a multiple of 3. Thanks, Bill Hi AFAIK this is not possible in Excel -- Regards Frank Kabel Frankfurt, Germany "Bill Allen" <ballense@cox.net> schrieb im Newsbeitrag news:1eq6d.26462$7k.7198@okepread05... > Is this available/possible? > The difference between engineering and Scientific is that engineering is > always in the form of "11.11En where "n" is a multiple of 3. > > Thanks, &g...

email to Public folder gets NDR
When I try to send a message to PF I get a NDR and following message in Application log Event Type: Warnin Event Source: MSExchangeTranspor Event Category: Exchange Store Driver Event ID: 32 Date: 31.05.200 Time: 9:50:2 User: N/ Computer: XMAI Description The following call : EcLocallyDeliverMsg2 to the store failed. Error code : 1238 (Message-ID <C8F74733BF2C7E4888545664F83970FC47162D@xmail.1111.ru> will be NDR'd). MDB : 0a07ea5d-c42f-41d6-9b26-1b91ceddf4dd. FID : 1-41. MID : 1-23E6CB. File : . But some other users can send messages without problems.. What does this error code(...

Outgoing messages occasionally don't get sent
I'm having a very strange problem with Outlook 2007. 99% of the time everything worked fine but once in awhile outgoing messages do not get sent and remain in the outbox. The only way I can get them to be sent is too close Outlook and then restart it at which time the messages get sent. When I close outlook I get the message that says I have mail in my outbox, do I want to close anyway or not close so Outlook knows there is mail there. I've tried pressing F9 and even then the mail doesn't get sent. I'm running this on a laptop using Microsoft Vista Home Premium and my mail...

Missing pictures when converting to pdf
When I convert a file to pdf, some of the pictures in the doc file do not make it into the pdf file. I tried several times. Tried creating a new Word file. Compressed pictures. Help, I have to deliver this document to my customer soon. Make sure that the pictures are embedded and not linked int he word file. Are u linking them?? "Martiart" wrote: > When I convert a file to pdf, some of the pictures in the doc file do not > make it into the pdf file. > I tried several times. Tried creating a new Word file. Compressed pictures. > Help, I have to deliver th...

How do I convert a two-part, black logo into two separate colors..
I have created a flyer/mailer for my small business. My company's logo are the two block letters 'C' (gold) and 'G' (Blue). I have the graphic saved in my clip arts. Up to now, I can only convert both letters to either all gold or all navy, but not two the two separate colors on the same page. Can anyone help! ReBell in Ms Hey Rebell, From what I've discovered (if the logo isn't too complicated), highlight your 'placed' logo, go to the 'Arrange' tab at the top of the screen and 'Ungroup' the logo. Once it's ungrouped, you shou...

CRM API: Converting an Object Type value -> ObjectType
I've setup post callouts in CRM which notify me when a CRM object has been modified. CRM sends me the ObjectType value so I know what type of object has been modified. For example 1 for an Account, 132 for an Activity... I can't figure out however how to convert the number back into an ObjectType. In theory it should be very simple, but from what I can tell the ObjectType class is NOT an Enum, oddly enough. I've tried the following: int objectTypeValue = 2; // which is a Contact // returns otActivity test = (ObjectType) Enum.ToObject(typeof(ObjectType), objectTypeValue); // r...

Which type of digital certificate to get from VeriSign for SignedXML
Hi all, Happy New Year. I am using SignedXML and an X509 certificate to digitally sign a SOAP message body and put the signature in the SOAP header for a B2B business application. Can you suggest which type of digital certificates from VeriSign is for this purpose? I checked VeriSign's web site but didn't find it obvious to decide. Thank you very much for your help. --- Guangxi Hi Guangxi, What about the Secure Site Services? SSL certificates are ideal for securing Web sites, intranets and extranets. It's cheap and guarantee every SSL session will receive powerful SSL enc...