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?

Recommended Posts

MrSandman666    122
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
Guest Anonymous Poster   
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