I thought it should be easy to make a function that returns a couple of spaces.
I use a 4 line LCD to display positive and negativ temperatures. I want to have the decimal points at the same position.
Of course there are several solutions; for instance lcd.setCursor(x,y) depending of the length.
I prefer to insert 0, 1 or 2 blanc spaces, calculated by a function.
Normally I prepare each LCD-line by compiling a strLine; now I get a lot of errors: invalid conversion from 'const char*' to 'char' [-fpermissive]
strLine2 = "Tm : " + Spaces(sngTm) + String(sngTm, 1) + " " + lcdDegrees + "C ";
char Spaces(float Temp)
{
char extraSpaces; extraSpaces = "";
//if (Temp=<-10) {extraSpaces[] = "";};
if (Temp>-10 && Temp<0) {extraSpaces = " ";};
if (Temp>0 && Temp<10) {extraSpaces = " ";};
if (Temp>10) {extraSpaces = " ";};
return extraSpaces;
}