I thought I had this figured earlier, but I can't seem to break the FFF-II-SS (Feet-Inches-Sixteenths) out into a variable that I can convert into a decimal. "m_feet" holds the initial value given by a user say 241012 which equals 24.89583 (24'-10-3/4"). No matter what I change the m_feet2 =, I still get the origional keyed in input (241012). I'm not sure if I'm just missing something here (prob. am) but it seems to me that adjusting the formula at the end should provide me with different results. Could this have anything to do with this code being in an MFC App, because I get better results in this code in a console app.
Any help is greatly appreciated...
UpdateData(TRUE);
char string[8] = {0,0,0,0,0,0,0,0}; // +1 for nul
int six=0;
int inch=0;
int feet=0;
sprintf(string, "%f", m_feet);
six = atoi(&string[strlen(string) - 2]);
string[strlen(string) - 2] = '\0';
inch = atoi(&string[strlen(string) - 2]);
string[strlen(string) - 2] = '\0';
feet = atoi(string);
m_feet2 = ((((six / 16.0) + inch) / 12.0) + feet); // prob. here!!!
UpdateData(FALSE);