Mas facil, no se compliquen:
if flt <= 9 then print " ",#flt
if flt >9 and flt <= 99 then print " ",#flt
if flt >99 and flt <= 999 then print " ",#flt
if flt >= 1000 then print #flt
con esa comprobacion es mas que suficiente.
ejemplo completo:
DEVICE=16F628
CONFIG INTRC_OSC_NOCLKOUT,WDT_OFF,PWRTE_ON,CP_OFF,BODEN_OFF,LVP_OFF,MCLRE_OFF
ALL_DIGITAL=TRUE "DESHABILITAMOS COMPARADORES ANALOGOS
PORTB_PULLUPS=ON "HABILITAMOS PULLUPS
DECLARE LCD_DTPIN PORTA.0
DECLARE LCD_ENPIN PORTB.3
DECLARE LCD_RSPIN PORTA.4
TRISA=%00000000
PORTA=%00000000
TRISB=%00111111
PORTB=0
DIM FLT AS word
DELAYMS 300 "ESPERAMOS QUE INICIE LCD
for flt=0 to 2000 step 10
cls
if flt <= 9 then print " ",#flt
if flt >9 and flt <= 99 then print " ",#flt
if flt >99 and flt <= 999 then print " ",#flt
if flt >= 1000 then print #flt
delayms 125
next
cls
print "OK"
delay 20000
Salu2