Lcd display problem

Hello everybody, so I bought one 16x2 lcd display to make something usefull out of it, and started to make some test programs to it, and I have a "little" problem when running this code:

#include <LiquidCrystal.h>


LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

void setup() {
  lcd.begin(16, 2);

}

void loop() {
lcd.clear();
lcd.print("rpm:");
lcd.setCursor(4,0);

for(int i=14000; i>0; i=i-100){
  lcd.setCursor(4,0);
  lcd.print(i);
  delay(100);
}
}

The problem is that when i pass for 10000 to 9900 the remaing 0 of the 10000 number is still being displayed as the lcd.print routine allways start writing from the 4 character position, is there any easy solution like aligning the number to the righ and not to the left as lcd.print does by default, is that possible to change?

Set the cursor. Print 5 spaces. Set the cursor to the same location. Print the number.

But that isn't a bit slow?
Well, its better than nothing, thanks!

For right-justified numbers:

for(int i=14000; i>0; i=i-100){
  lcd.setCursor(4,0);
[glow]  if (i < 10000 ) lcd.print(" ");[/glow]
  lcd.print(i);
  delay(100);
}

For left-justified numbers:

for(int i=14000; i>0; i=i-100){
  lcd.setCursor(4,0);
  lcd.print(i);
[glow]  if (i < 10000 ) lcd.print(" ");[/glow]
  delay(100);
}

You will eventually want to also add
[b]if (i < 1000) lcd.print(" ");[/b]
below those lines for when it changes from 1000 to 900 too.

Alternatively, put the number into a string before trying to send it to the LCD, then pad the string to a length of 5 with leading spaces as needed, and THEN send THAT to the LCD.... I think. I haven't tried this, but it "should"(?) work, shouldn't it?

Messing with strings inside the Arduino has (?) to be faster than "talking" to the LCD?