Monday, July 11, 2011

how to see the decimal precision in Edit Control MFC

Display Decimal Precision with Editbox




--------------------------------------------------------------------------------



I have 20 Variables defined as a float in my MFC which get displayed in an edit box .



My problem is when I initialize them I want them to be displayed with two zeros after the integer for ex 42.00 what it does is 42



I know other way is to define them as CString and do it but then the problem is making sure that the user enters is a legal float value and not garbage, which I think will be too much to do for 20 variables.



Is there a better way I can display the float value without using CString

m_b_value = 1.0f;




but the edit display is 1



How can I make it display 1.0?

http://www.codeguru.com/forum/showthread.php?t=351445


No comments:

Post a Comment

Health Benefits of Cashews

  Benefits of Cashews. Healthy food is an integral part of healthy body. Regular exercises such as Yoga and healthy diet is important to...