Using IR sensor/transmitter for slotcar detection

Regarding the decimal places, my internet searching revealed this forum post, which uses the

lcd.print(variable, 2);

The number after the variable is how many decimal places, which can range from 6 or 7 to 0.

I'm not sure it will work or not, as i don't have an I2C LCD, but it seemed worth a shot.