Jump to content
  • Advertisement

Archived

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

MrSandman666

vsprintf: how to get rid of the terminating zeros when using a float value?

This topic is 6436 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 use the vsprintf function in my program and I want it to print a float type variable like i.e. 5.67 but what it displays is 5.670000 using 5.67f doesn''t change anything. has anyone solved this problem?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You''ll have to parse through the format parameter and change all the %f to %.2f

Pray there are no %.6f in there




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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!