First of all, m_str should be a CString type variable associated with the edit box! M_str。 IsEmpty () means that if the edit box is not empty, m_str. GetLength () gets the length of m_str, such as 5. After subtracting 1, it becomes the numbers 4 and left, and then assigns the left four bits of m_str to m _ str. Achieved the function of calculator backspace.
f-int(f)& lt; The sentence = 1e-5 is to judge whether f is a floating-point number, such as f= 1.2, int(f)= 1, f-int(f)=0.2, and 0.2 is greater than 1e-5(0.00005 If it is plastic, execute m_str. Format ("%d", (int)f); f);