I have 2 numbers (temperatures) that I wish to display on a 16x2 LCD. Each of the temps can be 1-3 characters long (eg. 8degC up to 200degC) and I want to display each of the temps so that they are right aligned on the display. The last digit of the number will always be on the 6th character on each line, so the start of the number can either be 4th, 5th or 6th character on the line.
The temperature value are being stored in a byte. Is there a way to easily right align the number when is displayed on the LCD, or do I need to something fiddly like :
If the number is below 10 then goto 4th char before writing number...
If the number is between 10 and 99 then goto 5th char before writing number...
If the number is above 99, then goto 6th character before writing number...
Any ideas would be great.
The temperature value are being stored in a byte. Is there a way to easily right align the number when is displayed on the LCD, or do I need to something fiddly like :
If the number is below 10 then goto 4th char before writing number...
If the number is between 10 and 99 then goto 5th char before writing number...
If the number is above 99, then goto 6th character before writing number...
Any ideas would be great.