Like Henrik said, the formula is really subtracting 4000 from a WORD. So here's the way I tackled it:
Code:wCalc VAR WORD G3T VAR wCalc[0] G4T VAR wCalc[1] IF wCalc <4000 THEN 'Number will be negative DUMMY =MULT*(wCalc+B2) MG2_NM = DIV32 100 MG2_NM=10000-MG2_NM LCDOUT $FE, POS4-1,"-" ELSE 'Number will be positive or 0 Dummy = MULT*(wCalc-B2) MG2_NM = DIV32 100 LCDOUT $FE,POS4-1," " ENDIF IF MG2_NM < 100 THEN LCDOUT " " ELSEIF MG2_NM < 1000 THEN LCDOUT " " ENDIF LCDOUT DEC MG2_NM/10,".",DEC MG2_NM//10




Bookmarks