Now I've got a result for my text formatting problem [clicky] thanks to weaknessforcats, my next task is to centre the text on the display.
This isn't a normal display, it is a small LCD with custom drivers that I have written. I can manipulate where the cursor is, but first I need to calculate the horizontal offset based on the number (0 - 9999) that I want to display.
My first thought was a series of if statements that checked the number (say n)for n>9, n>99, or n>999 then set the offset accordingly. It would work, but not very elegant.
Any thoughts?