Number of digits setting for serial printing the sensor output value
You can use the C function sprintf: 

char text[5];
sprintf(text, "%04d", number);
Serial.println(text);


The leading 0 in 04d will add zero's for the length (4) is met, so 1 will become 0001, 10 will become 0010, 100 will become 0100 and 1000 will stay 1000.