int CTones=0 , CTtens=0 ,CThundreds=0;
unsigned int CTdv1=0;
float CT_SET = 8.03;
if(CT_SET >= 0 && CT_SET <= 10)
{
CTdv1 = CT_SET * 100;
dp0 = 1;
dp1 = 0;
dp2 = 0;
CTones = (byte)CTdv1%10;
CTtens = (byte)(CTdv1/10)%10;
CThundreds = (byte)(CTdv1/100)%10;
lc.setDigit(0,2,(byte)CTones,dp2);
lc.setDigit(0,1,(byte)CTtens,dp1);
lc.setDigit(0,0,(byte)CThundreds,dp0);
}
else if(CT_SET >= 10 && CT_SET <= 99)
{
CTdv1 = CT_SET * 10;
dp0 = 0;
dp1 = 1;
dp2 = 0;
CTones = (byte)CTdv1%10;
CTtens = (byte)(CTdv1/10)%10;
CThundreds = (byte)(CTdv1/100)%10;
lc.setDigit(0,0,(byte)CThundreds,dp0);
lc.setDigit(0,1,(byte)CTtens,dp1);
lc.setDigit(0,2,(byte)CTones,dp2);
}
else if(CT_SET >= 100 && CT_SET <= 999)
{
CTdv1 = CT_SET * 1;
dp0 = 0;
dp1 = 0;
dp2 = 0;
CTones = (byte)CTdv1%10;
CTtens = (byte)(CTdv1/10)%10;
CThundreds = (byte)(CTdv1/100)%10;
lc.setDigit(0,0,(byte)CThundreds,dp0);
lc.setDigit(0,1,(byte)CTtens,dp1);
lc.setDigit(0,2,(byte)CTones,dp2);
}
else if(CT_SET > 999)
{
lc.setChar(0,0,'-',false);
lc.setChar(0,1,'-',false);
lc.setChar(0,2,'-',false);
}
else if(CT_SET < 0)
{
lc.setChar(0,0,'-',false);
lc.setChar(0,1,'-',false);
lc.setChar(0,2,'-',false);
}