Jump to content
  • Advertisement
Sign in to follow this  
the incredible smoker

Floating point edit box

Recommended Posts

Hi, how would i read and write to a edit box text to float and float to text, with accuracy like the visual studio debugger ?

In the debugger i can fill in a number with 8 digits behind the point.

When i try this my numbers will change.

thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Posted (edited)

Read via GetWindowTextW() (or GetWindowTextA() if you are using multi-byte, or GetWindowText() if you change between Unicode and multi-byte sets via project settings).

Convert to text via swprintf_s() (or sprintf_s() for multi-byte sets or _stprintf_s() for use with TCHAR.h) using as many digits of precision as you want (%.17f prints a float out to 17 decimal places.  Read the Format Specifications).

Convert to a number via _wtof() or atof() (or _tstof() if using TCHAR.h).


L. Spiro

Edited by L. Spiro

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!