Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Doubles in Edit Boxes

This topic is 5994 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to display doubles in win32 edit boxes as well as retrive them. In the books I''ve read, there is only four methods to do this:
Since I need doubles, how would I display them and retrive them? I thought of converting it to text and then back again to doubles but this is not what I had in mind. However, if this is the only way to do it, kindly direct me to the functions needed to do this. Thanks!

Share this post

Link to post
Share on other sites
Original post by SabreMan
Look up sprintf().

I doubt if you understand what my problem is. Please read carefully. I know what sprintf() does; it prints text to a string. How does this help? Please elaborate. Your short posts serves only to insult my intelligence. =(

By edit boxes, I mean windows edit boxes such as the Name and Password fields when you startup windows.

How do I retrive doubles from edit boxes.

Edited by - Darkor on February 22, 2002 11:04:05 AM

Share this post

Link to post
Share on other sites
You will have to interpret the doubles as a string in both the Get and Set methods.

As SabreMan said, "Look up sprintf()"
sprintf is used like this
double myNumber = 65.37326;
char temp[ 64 ];
sprintf( temp, "%.6f", myNumber ); // 6 decimal places for the number

SetDlgItemText(..., myNumber, ... );

To retrieve you would interpret the text as a number and use "atof" to convert it to a double

Edited by - The Bear on February 22, 2002 11:16:34 AM

Share this post

Link to post
Share on other sites
Okay thanks!

Anyway, I was looking for a specific function that deals with the edit box itself.

But thanks anyway. I already know how to use sprintf and atof.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!