void DspData(unsigned long x) { unsigned char y; Num1 = (char)(x/100000); Num2 = (char)(x%100000/10000); Num3 = (char)(x%10000/1000); Num4 = (char)(x%1000/100); Num5 = (char)(x%100/10); Num6 = (char)(x%10); y = (Num1!=0)?Tab_Num[Num1]:D_Blank; DspBuf[0] = y; y = Tab_Num[Num2] ; if ((Num2==0)&&(Num1==0)) y = D_Blank; DspBuf[1] = y;
if ((Num3==0)&&(y==D_Blank)) y = D_Blank; else y = Tab_Num[Num3]; DspBuf[2] = y;
if ((Num4==0)&&(y==D_Blank)) y = D_Blank; else y = Tab_Num[Num4]; DspBuf[3] = y;
if ((Num5==0)&&(y==D_Blank)) y = D_Blank; else y = Tab_Num[Num5]; DspBuf[4] = y; DspBuf[5] = Tab_Num[Num6]; } |