Stopping CEdit to show floats in scientific notation
-
Hey! Let's say through the ClassWizard I have a variable attached to a CEdit control. When I type a small number (like 0.00000001), the number changes to "1e-008" automatically, which isn't what I want. How do I go about changing this default behavior? Steve The Plant
-
Hey! Let's say through the ClassWizard I have a variable attached to a CEdit control. When I type a small number (like 0.00000001), the number changes to "1e-008" automatically, which isn't what I want. How do I go about changing this default behavior? Steve The Plant
Sounds like you bound a data variable (like a double, or float) instead of a control class (like CEdit), and letting MFC do the value-to-text & text-to-value conversions for you. Bind a CEdit to the edit control, and handle the display/conversion yourself. Or, you could write your own DDX routine to format the value as you like. Look up "TN026" in MSDN for more information. Peace! -=- James.