tft.drawNumber print Millis()

Hi

I use the Adfruit Library to print the Millis() between a delay(1000) the numbers I get is the following:

1000,1001,1000,9991,1000…

The 9991 should not be there I think the last digit of the previous number does not get cleared and it

should be 999.I include a sample of what I do ,but forgive me I have no idea how to use the </> to post

code.

Any suggestions will help a lot.

 void loop()
  {
  
  unsigned long currentMillis = millis();
  delay(1000);
  unsigned long newMillis = millis();
  unsigned long printMillis = newMillis - currentMillis;
  
  tft.drawNumber(printMillis,60,60,2);//Print in centre of screen
  
  }

Any suggestions will help a lot./quote]
Print a space after the number to erase the surplus digit. Better still only do it when the number to be printed is less than 1000.

Thanks UKHeliBoB

I used the tft.drawNumber in the past but never noticed that when the number gets smaller the previous

number is not cleared right to the end.

When the number is 123456789 and the next number is 1 the spaces to add will vary, the next number could be

123456789 + 8 spaces, so now the coding gets complicated.(at least for me)

Printing a small rectangle over the numbers will clear all the number but causes a flicker.

I will play with the various options.

Thanks.